Message 1 of 2

Not applicable
06-05-2013
07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a macro that opens an iLogic form. The form is for updating custom iProperties in the title blocks of drawings (so all pages have the information in the title block.) Rule0, which calls the form, is also called when the document is created. When I run the macro is works fine until "iLogicAuto.RunRuleDirect." A box for the form pops up with nothing inside it, then freezes and inventor crashes.
Here is the macro code:
Sub EditProperties() Dim pDoc As Document 'Get iLogic addins Dim addIn As ApplicationAddIn Dim addIns As ApplicationAddIns Set addIns = ThisApplication.ApplicationAddIns For Each addIn In addIns If InStr(addIn.DisplayName, "iLogic") > 0 Then addIn.Activate Dim iLogicAuto As Object Set iLogicAuto = addIn.Automation End If Next Set pDoc = ThisApplication.ActiveDocument Dim rules As Object Set rules = iLogicAuto.rules(pDoc) If Not (rules Is Nothing) Then For Each rule In rules If (rule.Name = "Rule0") Then iLogicAuto.RunRuleDirect (rule) End If Next End If End Sub
Thanks in advance for any help.
Solved! Go to Solution.