Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Updating Mass Prop in I-logic

3 REPLIES 3
Reply
Message 1 of 4
Cris_Davis
1862 Views, 3 Replies

Updating Mass Prop in I-logic

I have an assembly that I am trying to get the weights everytime I update parameters.  Anyone have any clue if you can do this?  Not having much luck.  I am trying to use i-logic.  Has anyone written any rules that they would like to share?

 

Thanks

Siloman

3 REPLIES 3
Message 2 of 4
MegaJerk
in reply to: Cris_Davis

I have a parameter (units of lbmass) called AssemblyWeight.

 

This is the ilogic code I use to populate it

 

 

AssemblyWeight = iProperties.Mass

 

I then throw that into a Custom iProperty in the Assembly (also called AssemblyWeight) using the code :

 

 

iProperties.Value("Custom","AssemblyWeight") = Round(AssemblyWeight, 0)

 

Naturally I am rounding this down to 0 decimal places, so you can change that value depending on your needs.

 

You should also be able to force an iProperty in your drawing to use that value (from the iProperty in the assembly) to display anywhere.

 

I hope that this helps.



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 3 of 4
MjDeck
in reply to: Cris_Davis

It's a good idea to update the part before reading the mass.  You can do that with a rule like this:

InventorVb.DocumentUpdate()
AssemblyWeight = iProperties.Mass 

Do you want the mass to update everytime you change a parameter in one of the parts in the assembly?  I don't think it's possible to do that with iLogic.

 

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 4 of 4
ben.young
in reply to: Cris_Davis

You can use event triggers so that Inventor updates iLogic rules automatically.

 

Events that can be used as triggers:

 

New Document

After Open Document

Before Save Document

After Save Document

Close Document

Any Model Parameter Change

iProperty Change

Feature Suppression Change

Part Geometry Change

Material Change

 

Because we design subsea at eqiupment my work we use custom iPropeties and iLogic so that we can list weight on our 2D drawings of an object 'In Air' by using the following line:

iProperties.Value("Custom", "weight_in_air") = Round(iProperties.Mass ,1)

 

And the following line for weight 'In Water'

iProperties.Value("Custom", "weight_in_water") = Round(iProperties.Mass - (iProperties.Volume / 1000000), 1)

 

Of course that last line will depend on what settings you use. We work in metric.

 

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

Post to forums  

Autodesk Design & Make Report