Any fast way to get all node coordinates?

Any fast way to get all node coordinates?

lance.xi
Enthusiast Enthusiast
800 Views
1 Reply
Message 1 of 2

Any fast way to get all node coordinates?

lance.xi
Enthusiast
Enthusiast

I want to output all the nodes coordinates with NodeID.

The code I used is some one posted in the forum as following:

 

 

Dim StudyDoc, Node, Label, Coord
Set StudyDoc = Synergy.StudyDoc()
Set Node = StudyDoc.GetFirstNode()
While Not Node Is Nothing
    Label = StudyDoc.GetEntityID(Node)
    Set Coord = StudyDoc.GetNodeCoord(Node)
    DataFile.Write Label & Chr(9) & Coord.X & Chr(9) & Coord.Y & Chr(9) & Coord.Z & vbCrLf
    Set Node = StudyDoc.GetNextNode(Node)
Wend

 

The problem is that, when the model is complicated, it requires several hours to output.

 

Any other solution is faster?

 

Thanks!

0 Likes
801 Views
1 Reply
Reply (1)
Message 2 of 2

franco.costa
Autodesk
Autodesk

Hello Lance,

the fastest way is to export the mesh into a text file format such as the Patran format or the UDM format. This writes all the mesh information into a text which you can then quickly read back using standard vbs commands to get the coordinates.

In fact, this is how many of the scripts I have written read and process the mesh information. Some of these scripts are already included as part of the Moldflow Insight installation (Look in: C:\Program Files\Autodesk\Moldflow Synergy 2019\data\commands). For example, look at the ExportGasCoreSTL.vbs file and find the ReadData function in the MeshClass class. Notice also that ReadData is called in the Class_Initialize function immediate after the line: "Synergy.Project.ExportModel UdmName" which is the command to have a script write the mesh data into a text file having the name of path which is stored in the variabel UdmName.



Franco Costa
0 Likes