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