export body properties

export body properties

eladm
Collaborator Collaborator
639 Views
3 Replies
Message 1 of 4

export body properties

eladm
Collaborator
Collaborator

Hello

 

Can I get help for ilogic rule to export body properties to excel (area , volume , mass) 

From Multi body part or for single body  

eladm_0-1733032511638.png

 

Regards

0 Likes
640 Views
3 Replies
  • part
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor

This information is accessible from MassProperties of each body

Dim part As PartDocument = ThisDoc.Document
Dim bodies As SurfaceBodies = part.ComponentDefinition.SurfaceBodies
For Each body As SurfaceBody In bodies
	Dim info As New System.Text.StringBuilder
	info.AppendLine("Name: " & body.Name)
	info.AppendLine(String.Format("Mass: {0:N2}", body.MassProperties.Mass))
	info.AppendLine(String.Format("Volume: {0:N2}", body.MassProperties.Volume))
	info.AppendLine(String.Format("Area: {0:N2}", body.MassProperties.Area))

	Logger.Debug(info.ToString())
Next
0 Likes
Message 3 of 4

eladm
Collaborator
Collaborator

Hello

I run the rule , nothing happened ?  custom iProperties is empty , no user parameters were added and no Excel file was created 

regards

0 Likes
Message 4 of 4

Michael.Navara
Advisor
Advisor

This sample just show you how to access this information and print them to the iLogic log window. If you want to do something with this information you need to do it yourself.