Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 5
ludesroc
709 Views, 4 Replies

Part Mass

Hi, I'm using assembly COG to calculate load at specific locations. I need to set the exact weight of each components in the assembly in order to get accurate values. Is there a way to set Mass (iPorperties/Physical/Mass) via ETO? I tried --- IvExtSetPropertyValueByPropertyName(me, "Mass", "Mass", "100") but that didn't work! Regards,
Ludesroc
4 REPLIES 4
Message 2 of 5
Lesoux
in reply to: ludesroc

I know two ways for that.

 

1. In the factory file you need to create iLogic rule as Weight, for example and write this code:

    weight = iProperty.Mass

    Add trigger on this rule to update rule when something changed. You need to be sure that "weight" variable has been created in parameters.

    Adopt factory file and select your weight variable as read-only. After that you can call this variable in Intent anytime and anywhere.

 

2. Using API. You can either create method or function.

    Method weight(target As Part) As Number

        Dim obj As Any = GetHostObject(target)

        Dim compDef As Any = obj.Definition

        Dim massProps As Any = compDef.MassProperties

        massProps.Accuracy = k_VeryHigh ' k_High, k_Low, k_Medium, k_None, k_VeryHigh

        

        Return massProps.Mass

    End Method

 

Try to play.

 

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 3 of 5
ludesroc
in reply to: Lesoux

Thanks Lesoux, I Think iLogic solution is the simplest approach. Actually I did it the other way around... 1- Created a user parameter (myWeight). 2- Created an iLogic rule: iProperty.Mass = myWeight 3- Adopted the part (with new parameter) 3- ETO: Got the mass value from a database and passed it to the child parameter (myWeight) Now the assembly COG is updating as expected! Best Regards,
Ludesroc
Message 4 of 5
Lesoux
in reply to: ludesroc

Lol.

 

You wanted set a mass to the part. I shown you how to get mass from the part. Definitely, all my minds is mixed in my head.

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 5 of 5
ludesroc
in reply to: Lesoux

Hehe...I understand.....It's friday! 😉
Ludesroc

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report