issue with iProperties mass not always updating properly

issue with iProperties mass not always updating properly

montylowe
Enthusiast Enthusiast
1,071 Views
8 Replies
Message 1 of 9

issue with iProperties mass not always updating properly

montylowe
Enthusiast
Enthusiast

I'm having issues with the mass of my parts not updating after I change material via ilogic code. It is acting like the mass is is an override. If I delete the mass manually and update it then become the correct mass. The code I am using is very basic. Any help would be greatly excepted......

 

Monty

 

 

Select Case HDRMATL
Case = 1
iProperties.Material = "SA516-70"
Case = 2
iProperties.Material = "SA516-70N"
Case = 3
iProperties.Material = "SA240-304"
Case = 4
iProperties.Material = "SA240-304L"
Case = 5
iProperties.Material = "SA240-316"
Case = 6
iProperties.Material = "SA240-316L"
Case = 7
iProperties.Material = "SA240-S31803"
Case = 8
iProperties.Material = "SA240-S32750"
Case = 9
iProperties.Material = "SB424-N08825"
Case = 10
iProperties.Material = "SA537-CL1"
Case = 11
iProperties.Material = "SA387-11"
End Select
0 Likes
1,072 Views
8 Replies
Replies (8)
Message 2 of 9

MjDeck
Autodesk
Autodesk

You don't have another rule that is setting the mass?

 

If there is an override, you can remove it in your rule.  Add this to the end of the rule:

 

iProperties.Mass = -1  ' remove the override

InventorVb.DocumentUpdate()

mass = iProperties.Mass  ' recalculate the mass

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 9

montylowe
Enthusiast
Enthusiast

Thanks Mike

 

Works great

0 Likes
Message 4 of 9

montylowe
Enthusiast
Enthusiast

Mike having an issue with the mass updating now all values are N/A

0 Likes
Message 5 of 9

MjDeck
Autodesk
Autodesk

The values are N/A when you open the iProperties dialog, right?  I think that's normal behavior.  The mass isn't calculated until it's requested.   Can you provide more details and maybe post a part?

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 6 of 9

montylowe
Enthusiast
Enthusiast

Can you request it to be calculated per ilogic code?

0 Likes
Message 7 of 9

MjDeck
Autodesk
Autodesk

Yes, you can recalculate the mass using the code that I posted above:

 

InventorVb.DocumentUpdate()

mass = iProperties.Mass  ' recalculate the mass

 

But if you put this in a rule, the question then is: how do I make sure this rule gets fired?  Do you really need the mass to be always up-to-date?   How do you use the mass?

 

On the Tools -> Application Options dialog, on the General tab, there is an option Update physical properties on save.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 8 of 9

montylowe
Enthusiast
Enthusiast
Spoiler
It is part of a BOM rule the sets custom var's to populate the BOM structure. I am contorling the rule with Event Triggers.
0 Likes
Message 9 of 9

MjDeck
Autodesk
Autodesk

If you are modifying Inventor parameters in the same rule, you should add another statement:

 

RuleParametersOutput()
InventorVb.DocumentUpdate()
mass = iProperties.Mass


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes