Wednesday, March 16, 2016

iProperty Compliance Through iLogic

A common request I hear from CAD Managers is for a way to force their users to fill in all the necessary iProperties on models and/or drawings.  I still have not found a way to make this happen, but I have a way to use iLogic to "nudge" users toward iProperty compliance.

The solution is fairly simple.  First, you need to have an iLogic Form that has all mandatory iProperties, a Global Form would be best for this.  Then you can create a rule that will display that iLogic Form.  It is a pretty simple rule, just one line based on the Show Global Form snippet.

iLogicForm.ShowGlobal("My iProperties", FormMode.Modal)

Once the form and the rule are written, Event Triggers can be set for the events that should trigger the rule.  The "After Open Document" would be a good choice for showing the iProperty Form.

Another element that can be added to take the solution to the next level is a rule that will check to see if the iProperties have a value assigned.  There are a couple ways to do this, but the simplest way is to test the length of the string to see if it is greater than 0 characters.  In the rule that tests for values in the iProperties, it is important to have a counter to count how many empty iProperties have been found.  Once all the properties have been tested, an If/Then statement will be needed to run whatever procedure is determined should occur if empty iProperties exist in the file.  There are several options here, but at the very least the iProperty Form should be displayed.  Here is a sample of what that rule could look like.

BlankProps = 0

If Len(iProperties.Value("Project", "Part Number")) = 0 Then
    BlankProps = BlankProps + 1
End If

If Len(iProperties.Value("Project", "Description")) = 0 Then
    BlankProps = BlankProps + 1
End If


If BlankProps > 0 Then
    iLogicForm.ShowGlobal("My iProperties", FormMode.Modal)
End If

It is then necessary to set an Event Trigger for the checking rule, "After Save Document" is a good choice for this.

Then all of this can be rolled into a part, assembly, and/or drawing template.

Below is a video that demonstrated the process from beginning to end.



No comments:

Post a Comment