Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic rule, batch process

5 REPLIES 5
Reply
Message 1 of 6
JorisSteurs1246
627 Views, 5 Replies

Ilogic rule, batch process

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. 

 

Tags (2)
5 REPLIES 5
Message 2 of 6
Jefkee
in reply to: JorisSteurs1246

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...

Inventor 2013
Message 3 of 6
JorisSteurs1246
in reply to: Jefkee

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. 

Message 4 of 6

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....

Message 5 of 6
Jefkee
in reply to: JorisSteurs1246

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

 

Inventor 2013
Message 6 of 6
JorisSteurs1246
in reply to: Jefkee

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums