• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor Customization

    Reply
    Contributor psp
    Contributor
    Posts: 28
    Registered: ‎11-19-2003

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

    112 Views, 2 Replies
    03-08-2012 01:59 PM

    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.

    Please use plain text.
    Valued Mentor
    Mike.Wohletz
    Posts: 351
    Registered: ‎07-29-2008

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

    03-08-2012 06:53 PM 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.

     

    Please use plain text.
    Contributor psp
    Contributor
    Posts: 28
    Registered: ‎11-19-2003

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

    03-11-2012 11:05 PM 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.

    Please use plain text.