turboanden
Mechanical
- Jul 4, 2005
- 5
hi
I have made this macro to plot some points in a sketch, but depending on if there is zoomed out or in, it will plot it wrong or right.
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
A = 0.3
B = 0.3
X = 0
C = 0
Y = 0
K = 0.8
ST:
X = X + 0.1
Y = A * X ^ 2 + B * X ^ 2 + C
Part.CreatePoint2 X, Y, 0
If X < K Then GoTo ST
End Sub
I have made this macro to plot some points in a sketch, but depending on if there is zoomed out or in, it will plot it wrong or right.
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
A = 0.3
B = 0.3
X = 0
C = 0
Y = 0
K = 0.8
ST:
X = X + 0.1
Y = A * X ^ 2 + B * X ^ 2 + C
Part.CreatePoint2 X, Y, 0
If X < K Then GoTo ST
End Sub