Soli Body - Mass - Error

Soli Body - Mass - Error

iva.btblan
Advocate Advocate
569 Views
3 Replies
Message 1 of 4

Soli Body - Mass - Error

iva.btblan
Advocate
Advocate

 

I cannot identify the problem.
I want to put the weight of solid1, solid2 and solid3 - Iproperties - Custom.
Someone could help.

Thank you!

 

Iva.btblan

0 Likes
Accepted solutions (2)
570 Views
3 Replies
Replies (3)
Message 2 of 4

iva.btblan
Advocate
Advocate

Include

0 Likes
Message 3 of 4

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, I can't open the file because I work with inventor 2020.
Here I show you an example of how I would access the mass of solids. There must be many ways, but I hope this can serve you. Keep in mind that this method works with inventor internal units, and that is why I put kg in the unit.
I'll see if I can find an alternative route.
I hope this can help you

 

Dim doc As PartDocument = ThisDoc.Document
Dim oCD As PartComponentDefinition = doc.ComponentDefinition
Dim oDensity As Double= oCD.MassProperties.Mass / oCD.MassProperties.Volume

Dim oBody1 As SurfaceBody = oCD.SurfaceBodies(1)
Dim oBody2 As SurfaceBody = oCD.SurfaceBodies(2)
Dim oBody3 As SurfaceBody = oCD.SurfaceBodies(3)

iProperties.Value("Custom", "SolidMass1") = Round(oBody1.Volume(0.01) * oDensity, 3) & "Kg"
iProperties.Value("Custom", "SolidMass2") = Round(oBody2.Volume(0.01) * oDensity, 3) & "Kg"
iProperties.Value("Custom", "SolidMass3") = Round(oBody3.Volume(0.01) * oDensity, 3) & "Kg"

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 4 of 4

iva.btblan
Advocate
Advocate
Accepted solution

Thank you!

I couldn't understand.

With your explanation.

Everything was easy to understand.

Thank you!

0 Likes