iLogic To Update Mass Properties With Include QTY Overrides

iLogic To Update Mass Properties With Include QTY Overrides

kwalker1
Enthusiast Enthusiast
1,744 Views
1 Reply
Message 1 of 2

iLogic To Update Mass Properties With Include QTY Overrides

kwalker1
Enthusiast
Enthusiast

Hi All,

 

In an assembly's iproperties on the Physical tab, there is an option to tick a box to "Include QTY Overrides".

 

I am trying to automatically update the mass properties with is option selected with some iLogics.

I have the following two codes which I could use either to update the mass but they both don't account for the quantity overrides.

Does anyone know of a way to set the iLogic code to update the mass with the QTY Overrides included?

 

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppUpdateMassPropertiesCmd").Execute

 

InventorVb.DocumentUpdate(iProperties.Mass)

Just as bit of background info, I have some internal components (tube support boxes) that are located at multiple points within the equipment.

I have a set of boxes inserted into the assembly at one location because I need to show a typical cross-sectional view on the drawing.

But to account for the other locations, the quantity of the boxes are overridden. This is why I have overrides for these couple of components otherwise I always try to avoid any such overriding.

 

Any assistance would be much appreciated.

0 Likes
Accepted solutions (1)
1,745 Views
1 Reply
Reply (1)
Message 2 of 2

kwalker1
Enthusiast
Enthusiast
Accepted solution

OK. After a bunch of research plus trial and error I have finally worked out the code to select the "Include Qty Overrides" option via iLogics.

 

So for anyone needing it in the future, here's the code.

 

Dim oDoc As AssemblyDocument
    oDoc = ThisApplication.ActiveDocument
	
'Set a reference To the mass properties Object.
Dim oMassProps As MassProperties
oMassProps = oDoc.ComponentDefinition.MassProperties

'Set option to include quantity overrides in mass property update.
oMassProps.IncludeQuantityOverrides() = True
DryMass = oMassProps.Mass()

iProperties.Value("Custom", "MASS (DRY)") = DryMass
iProperties.Value("Custom", "MASS (OPERATING)") = DryMass + Parameter("OPERATING_FLUID_MASS")
iProperties.Value("Custom", "MASS (HYDROTEST)") = DryMass + Parameter("HYDROTEST_FLUID_MASS")

Regards,

Kurt.

0 Likes