~Newbie~
The big picture...I have a point cloud with hundreds of points andI want to draw a line between point 1 & 2, and then between 3& 4 and so on.
Where I started...
I recorded a macro. I created 4 points in a 3dsketch. (startrecord) I started a second 3d sketch and create a line betweenpoint 1 and 2 and then between 3 and 4. (stop record) When lookingat the code it uses the xyz value of the points I selected.
How do I specify each point (Point1@3dSketch1) instead of the xyzof the point? How do I make this repeat for each pair?
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.Insert3DSketch True
Dim skSegment As Object
Set skSegment = Part.SketchManager.CreateLine(0.029958, 0#,-0.128627, 0#, 0.015864, 0.158264)
Part.SetPickMode
Part.ClearSelection2 True
Set skSegment = Part.SketchManager.CreateLine(0#, 0.019677,-0.03524, 0#, 0.063835, 0.0878)
Part.SetPickMode
Part.ClearSelection2 True
End Sub
Thanks for any help!
CodySolidworksApi macros

The big picture...I have a point cloud with hundreds of points andI want to draw a line between point 1 & 2, and then between 3& 4 and so on.
Where I started...
I recorded a macro. I created 4 points in a 3dsketch. (startrecord) I started a second 3d sketch and create a line betweenpoint 1 and 2 and then between 3 and 4. (stop record) When lookingat the code it uses the xyz value of the points I selected.
How do I specify each point (Point1@3dSketch1) instead of the xyzof the point? How do I make this repeat for each pair?
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.Insert3DSketch True
Dim skSegment As Object
Set skSegment = Part.SketchManager.CreateLine(0.029958, 0#,-0.128627, 0#, 0.015864, 0.158264)
Part.SetPickMode
Part.ClearSelection2 True
Set skSegment = Part.SketchManager.CreateLine(0#, 0.019677,-0.03524, 0#, 0.063835, 0.0878)
Part.SetPickMode
Part.ClearSelection2 True
End Sub
Thanks for any help!
CodySolidworksApi macros
