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
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.
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.
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.