ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
SBSteven Bird28/04/2009
~Newbie~

The big picture...I have a point cloud with hundreds of points and I 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. (start record) I started a second 3d sketch and create a line between point 1 and 2 and then between 3 and 4. (stop record) When looking at the code it uses the xyz value of the points I selected.

How do I specify each point (Point1@3dSketch1) instead of the xyz of 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!
Cody