Does anyone know how to create a list of all mesh names from the SIM File.
I found this code here and it work great on a FEM file, but can't get it to work inside a Sim File.
How can I get the "GetMeshCollectors to work with a SimPart instead
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
Dim femPart As CAE.FemPart
femPart = CType(theSession.Parts.BaseWork, CAE.FemPart)
For Each theMeshCollector As CAE.MeshCollector In femPart.BaseFEModel.MeshManager.GetMeshCollectors
For Each theMesh As CAE.Mesh In theMeshCollector.GetMeshes
lw.WriteLine(" name: " & theMesh.Name)
Next
Next
End Sub
RE: create a list of all mesh in SIM file (instead of a FEM file
I do no thing you can directly as the meshcollector() "belongs" to the FEM. But you should be able to access which FEMs are "attached" to the sim
Dim theSimPart As NXOpen.CAE.SimPart = theSession.Parts.BaseWork
Dim femPart As NXOpen.CAE.BaseFemPart = theSimPart.FemPart
Thanks
Regards