Ask and answer engineering questions

Learn from millions of experts

Missing feed

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

By Hammerson99 on 26 Jun 15:21 1 answer 264 views 0 comments

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?

1 answer

  • Hammerson99
    Hammerson99 about 2 years ago

    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)
    Close #1

    Part.ShowNamedView2 "*isometric", 7
    End Sub

Add your answer to: "How do I construct a script for reading nodes into Solidworks?"

Save Cancel