Ilogic rule, batch process

Ilogic rule, batch process

JorisSteurs1246
Advocate Advocate
838 Views
5 Replies
Message 1 of 6

Ilogic rule, batch process

JorisSteurs1246
Advocate
Advocate

I have an external Ilogic rule to print to PDF in my +/- 500  InventorDWG's
Question now is, if someone has a tip on how to batch process this Ilogic rule without opening all the DWG's manually one by one. 

 

0 Likes
839 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

You could use code injector to add rule into a file and run it?

 

 

http://beinginventive.typepad.com/being-inventive/2012/02/injecting-ilogic-code-and-ilogic-event-tri...

Message 3 of 6

JorisSteurs1246
Advocate
Advocate

It looks promising, but when taking a closer look to the screenshot it can do only ipt, aim and idw.

I'm dealing here with DWG. 

0 Likes
Message 4 of 6

JorisSteurs1246
Advocate
Advocate

Sorry about that, it looks as DWG is added later on and they kept the old screenshot.

So by now i was able to "inject " a line of code that triggers an external ilogic rule. 

Now just finding a way of triggering this without manual labour....

0 Likes
Message 5 of 6

Anonymous
Not applicable

If it was on .ipt level we could trigger it from the TOP-assembly with this rule. But i don't think it is possible to do this for .dwg.

 

'**********************************************************
'******************** Activate rule in parts. ******************** '********************************************************** Sub Main auto = iLogicVb.Automation ' Set Rule name Dim ruleName As String ruleName = "Rule name here" ' Get the active assembly. Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument ' Get all of the referenced documents. Dim oRefDocs As DocumentsEnumerator oRefDocs = oAsmDoc.AllReferencedDocuments ' Iterate through the list of documents. Dim oRefDoc As Document For Each oRefDoc In oRefDocs Dim rule As Object rule = auto.GetRule(oRefDoc, ruleName) If (rule Is Nothing) Then 'Call MsgBox("No rule named " & ruleName & " was found in the document.") Else 'MessageBox.Show(rule.Name, oRefdoc.displayname) Dim i As Integer i = auto.RunRuleDirect(rule) End If Next End Sub

 

0 Likes
Message 6 of 6

JorisSteurs1246
Advocate
Advocate

Thanks Jefkee for this code, my approuch for ipt  would be set the trigger on iproperty change and than in the top assy BOM change the revision number  ( or other property)  I didn´t check this out yet, because I´m still dealing with my DWG´s.

0 Likes