Find us on Google+ Creating a Simple Release Reminder Using iLogic ~ Inventor Tales

Wednesday, January 26, 2011

Creating a Simple Release Reminder Using iLogic

“The best solutions are often simple, yet unexpected.”
 Julian Casablancas

The other day I found myself trying to find a way to get a release state (Work in Progress, In Review, Released, Obsolete) to appear on the drawing. 


That first part is no problem.  You can do that with iProperties.

A custom iProperty holding the release state.

But, how do we help the =remember to set the state.  We're all guilty of forgetting, right?

That's where a little iLogic can come in.  We can set a reminder to remind us to set the state.

First, we create some parameters in iLogic.  In this case, I've named it "Design_State".  Notice that this is a multi-value list.

The multi-value list.
Now I add rule to use this multi-value list.

Creating and naming the rule

Once the rule is named, you can use the wizard to build the rule. 

Typing the rule in the wizard
Here's the text itself.


'Updates rule when done
iLogicVb.UpdateWhenDone = True

'Creates input list dialog box & allows the user to choose the state
Design_State = InputListBox("Enter Current Work State", MultiValue.List("Design_State"), Design_State, Title := "Work State", ListName := "Available States")

'Writes values to Custom iProperty
iProperties.Value("Custom", "Release_Condition") = Design_State

'Saves file in this rule
ThisDoc.Save

This will create the rule.  But there's still one issue left over.  How can we trigger the rule so it reminds us to check this state, while at the same time not nagging us all the time?

We can edit the event triggers, and set the rule to fire when the document closes.  This way, the rule will ask us to check the state of the drawing.
Setting the event trigger
Here's a little tip on the rule.  You'll might notice that the rule saves the document at the end.  That's to make sure that the file is saved with the state I've set in the rule!

One last step, not related directly to the rule.  I place the custom property into my title block, so the text will show on the drawing.  

The iProperty called out on the drawing


Now, with the parameters set, and the triggers in place, I can close the drawing.  The event trigger fires the rule, and I can set the value of my state.

Firing the rule
There it is!  I hope this helps those who want to create a simple reminder, populate fields, or some combination of everything!  

For reference, here are some previous posts I've made on iLogic that may help if you want more information on some of the steps I've used here.

My post on Creating a Warning Dialog Box (shows process of creating a rule)

My post on Creating a Drawing Format (shows creating a multi-value list)

My post on using  Event Triggers to control when a rule fires

And for good general knowledge on iLogic.  Here's a video from Rob Cohee's Youtube Channel.

So there we go, another little midweek blog on iLogic.  Enjoy!






No comments:

Post a Comment