One thought on “p10

  1. mvba script code

    Sub spiral17()
    Dim startPoint As Point3d
    Dim point As Point3d, point2 As Point3d
    Dim lngTemp As Long
    Dim radius As Double
    Dim angle As Double
    Dim xdist As Double
    Dim ydist As Double
    Dim npoints As Integer
    Dim zdist As Double
    Dim divisor As Integer
    Dim turn As Integer
    Dim maxpoints As Integer
    angle = o
    radius = 1
    maxpoints = 100
    zdist = 0
    For npoints = 1 To 200
    angle = angle + (Pi / 48)
    xdist = xdist + Cos(2 * angle)
    ydist = ydist + Sin(2 * angle)
    zdist = zdist + Sin(2 * angle)

    ‘ Start a command
    CadInputQueue.SendCommand “ACTIVE WEIGHT 1”
    CadInputQueue.SendCommand “DMSG ACTIVATETOOLBYPATH
    \Drawing\Linear\Place SmartLine”
    CadInputQueue.SendCommand “PLACE SMARTLINE
    ‘ Coordinates are in master units
    startPoint.X = 0
    startPoint.Y = 0
    startPoint.Z = 0
    ‘ Send a data point to the current command
    point.X = startPoint.X
    point.Y = startPoint.Y
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = (startPoint.X + xdist) + Cos(angle / 2)
    point.Y = (startPoint.Y + ydist) * Sin(angle / 2)
    point.Z = (startPoint.Z + zdist) * angle / 2
    CadInputQueue.SendDataPoint point, 2

    ‘ Send a reset to the current command
    CadInputQueue.SendReset
    CommandState.StartDefaultCommand

    ‘ Start a command
    CadInputQueue.SendCommand “ACTIVE WEIGHT 4”
    CadInputQueue.SendCommand “PLACE POINT”
    ‘ Coordinates are in master units
    startPoint.X = 0
    startPoint.Y = 0
    startPoint.Z = 0
    ‘ Send a data point to the current command
    point.X = startPoint.X
    point.Y = startPoint.Y
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 2
    point.X = (startPoint.X + xdist) + Cos(angle / 2)
    point.Y = (startPoint.Y + ydist) * Sin(angle / 2)
    point.Z = (startPoint.Z + zdist) * angle / 2
    CadInputQueue.SendDataPoint point, 2
    ‘ Send a reset to the current command
    CadInputQueue.SendReset
    CommandState.StartDefaultCommand

    Next
    End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s