Pages

Sunday, October 27, 2013

Triggering an iLogic Form when Placing a Component in an Assembly

“One person can trigger a million thoughts.”
Anonymous

Earlier this week, KETIV presented the Autodesk Manufacturing Academy.  As always, the event was fantastic, and I got to see a lot of fellow Inventor users, and friends as well.

One question that was posed during the session was: "Can I set up an iLogic trigger in such a way, that when I start a new file from a template, the iLogic form will show up automatically?" 

The short answer.... Yes!

Here's how it works.

First, the background.  I have a template for sizing a wooden board, and determining if it's got a tenon joint or not.  The parameters are driven by an iLogic form named "Board Options"


An example of the form and the board it drives

Since I place these parts in an assembly, and want to resize them, I want the dialog to pop up when I create a new component in an assembly when using this template.

I can't just trigger the dialog box directly, but what I can do is create a rule with a single line of code that opens the dialog box.   And I can trigger that rule to run when I start the assembly.

The first step is to create a rule, in this case I named it "Trigger Dialog", and add the following line:

iLogicForm.Show("Board Options")

An example of the iLogic rule with the required code.


This simple line will open the dialog box, but in order for everything to work as intended, one more thing is required.

An event trigger needs to be added by choosing the "Event Triggers" icon from the iLogic panel.  This is found on the Manage tab.

Set the Trigger Dialog rule to run when a new document is started. 

Setting up the Event Trigger


 Now, when the file is started from a template, the dialog box, fired by the rule, will open. 

And the resizing can begin!

P.S. If you'd like a copy of this file to take a look at, it's available on GrabCAD!  Click on this link!

7 comments:

  1. Great Job Jon,

    Did you see this post by Luke Davenport this week? An essential concept for anyone dealing with iLogic.

    iLogic – Stabilise Browser Nodes in Assembly - Blog - CADline Community http://cadso.co/1cc4LLy

    ReplyDelete
    Replies
    1. That is a great post! A huge help!

      Thanks for sharing, Paul!

      Delete
  2. Hi, I tried your suggestion but it did not work, maybe because I'm placing an iLogic assembly in a new assembly...I only get the ugly table :( not the fancy form I made. Do you know what could be the problem in this case?

    ReplyDelete
  3. Hi Jon, I tried your suggestion but it did not work for me, maybe because I'm placing an iLogic assembly into a new assembly...I only get the ugly table not the fancy form I made...Do you have any tricks regarding this?

    ReplyDelete
    Replies
    1. Sigurdur, did you trigger the rule? Or the form? Make sure you trigger the form. Otherwise you might get the "ugly form".

      I hope that helps!

      Delete
    2. Well, as is often the case...when you finally take the time to ask for help everything starts to work all of a sudden :D Thanks for your prompt reply...I have my amazing form appearing as of now!

      Delete
    3. Murphy's law, as they say! I'm glad it's working!

      Delete