How do I construct a script for reading nodes into Solidworks?

I am able to import points from a text file following the instructions(creating a macro-script given below). Though I inserted coordinates for 50 points in total, there are fewer points shown in the interface.

How do I solve this?

Answer
 
Comments 0

1 Answer

Sub main()

Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
swApp.ActiveDoc.ActiveView.FrameState = 1
Dim skPoint As Object

Open "C:\123.txt" For Input As #1
Part.SketchManager.Insert3DSketch True
Do While Not EOF(1)
Input #1, X, Y, Z
Set skPoint = Part.SketchManager.CreatePoint(X / 1000, Y / 1000, Z / 1000)
Loop
Close #1

Part.ShowNamedView2 "*isometric", 7
Part.ViewZoomtofit2
End Sub

 
Comments 0