cancel
Showing results for 
Search instead for 
Did you mean: 

Export total mass of FE model

Creator
Creator

Hello everyone!

 

I would like to write a method that opens a FEM file and exports the total mass of the model. Is there a simpler and more efficient way to do this besides writing a loop that finds all elements, combines them into an array of TaggedObjects and passes the array into a solid property check builder? Even with the builder it does not seem like there is a direct method to get the total mass as well, although by using Solid Properties Check interactively the information window would print the total mass directly.

 

 

 

 

4 REPLIES

Re: Export total mass of FE model

Phenom
Phenom

I did something like that/similar a while ago but don't think I totally finished - Work got in the way

 

you can write the data from the info window to a (.tx) file of your choice then parse it. It's just a matter of searching for keywords, see below;

 

If sline.Contains("Total Mass") Then
salinefield = sline.Split(New Char() {":"c})
salinesubfield = salinefield(1).Trim.Split(New Char() {" "c})
mystringbuilderlocal.Append(salinesubfield(0)).Append(",")
End if

If sline.Contains("Nonstructural Mass") And bSelectNSM = True Then
salinefield = sline.Split(New Char() {":"c})
salinesubfield = salinefield(1).Trim.Split(New Char() {" "c})
mystringbuilderlocal.Append(salinesubfield(0)).Append(",")
End if

 

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Export total mass of FE model

Creator
Creator

Hello selex_ct,

 

Thanks for the suggestion! I had the idea of printing the information window out as well but I've found a method that is simpler and more direct for the scripts that I'm writing. If you have the .prt file with the materials already defined you can simply use the MeasureBodies method to get body properties such as the volume, mass, area etc. There's a pretty good example of this on SolutionCenter. Hope this helps you with what you were working on before!

Re: Export total mass of FE model

Phenom
Phenom

Will have a look at your suggestion

 

The idea behind the programm I have (trying to do) is within a fem (or .afm) get the mass (split or not with NSM) is to get the mass of elements within a selectin of groups. The data is presented in a "tabular" format. In effect if one creates 1 group/part (area of interest) one can get the info quickly without having to do one a time and in a format that can be use as-is (copy -paste inb a report!)

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Export total mass of FE model

Phenom
Phenom

Will have a look at your suggestion

 

The idea behind the programm I have (trying to do) is within a fem (or .afm) get the mass (split or not with NSM) get the mass of elements within a selection of groups. The data is presented in a "tabular" format. In effect if one creates 1 group/part (area of interest) one can get the info quickly without having to do one group a time and in a format that can be use as-is (copy-paste in a report!)

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)