Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parameters not calculated - can't rebuild with UI or iLogic

2 REPLIES 2
Reply
Message 1 of 3
psp
Enthusiast
506 Views, 2 Replies

Parameters not calculated - can't rebuild with UI or iLogic

In the attached file there is a User Parameter, "Antal_ledekasser". Inventor has calculated its value to 2.

If you do the math by hand then you see the value should be 5.

 

Rebuild doesn't force recalculation.

There is an iLogic rule in the part, but this also fails to force recalculation:

iLogicVb.UpdateWhenDone=True
InventorVb.DocumentUpdate()
ThisDoc.Document.Rebuild2
ThisDoc.Document.Update2

 

Manual work around is to change the formula, then the value is recalculated.

iLogic work around is to change a parameter-value - and run the rule TWICE.

 

Question: How do I force a real rebuild, that actually wil recalculate parameter-values the first time I run the iLogic rule?

 

 

Background:

The attached file is a little subset of the skeleton in a large assembly that is controlled by iLogic. The rules are placed in the topassembly, and writes vaules to the skeleton-file.

After writing values to skeleton-parameters I try to force them through with this iLogic code:

RuleParametersOutput()
InventorVb.DocumentUpdate()
iLogicVb.RunRule("Skeleton", "Update")

Later in the process I use calculated values to decide which components should be active. But my logic fails because my decisions are made on faulty values.

I did manage to get the updating work in 2011. But after migrating to 2012, it seems impossible to have it update correct. The user has to run rules several times, and doing manually updates to get a correct model.

2 REPLIES 2
Message 2 of 3
Mike.Wohletz
in reply to: psp

I see the problem, I don't know if this is a workable solution for you but below is what I did to make it work. I have a tough time getting iLogic to do what I really want when I calculate multiple cascading parameters. I would move the calculations into the code and let is solve the problem for you in one pass, this will also prevent iLogic from triggering multiple times and causing a performance impact.

 

 

 

' Uncomment next line - then the rule will update and rebuild the model and value - but not until the second time this rule is run
'Parameter("Plade_L")=Parameter("Plade_L")+1
Antal_ledekasser = Max(Floor(( Dybde_indv_ovnrum - 150 mm - BOT * 75 mm ) / ( 850 mm + BOT * 75 mm )),1 ul)
InventorVb.DocumentUpdate()
ThisDoc.Document.Rebuild2	
ThisDoc.Document.Update2	
MessageBox.

 

Message 3 of 3
psp
Enthusiast
in reply to: Mike.Wohletz

Hi Mike

 

Thanks for your input. But unfortunately it isn't realistic. I have litteraly thousands of calculations. Digging deeper, I have also found that sometimes cascading derived parts are un-updateable: http://screencast.com/t/bpUogI3r

 

For now, I guess I have to roll back to 2011, since it worked well here. We will then skip 2012, test 2013 and then decide what to do with our iLogic configurator.

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

Post to forums  

Autodesk Design & Make Report