Message 1 of 4
Run External Rule in each part
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to repurpose this code to instead of running that rule in each assembly but find each part in a assembly that has that rule in it and run a external rule in each part. But i want it to only run the external rule if the part already has "Master_Parts_List" in it. I am having difficulty getting it to work, help would be appreciated
Dim oDoc As AssemblyDocument = ThisDoc.Document
'define the ilogicAutomation
Dim iLogicAuto As Object
iLogicAuto = iLogicVb.Automation
Dim oRuleName As String = "Master_Parts_List"
Dim oRule As Object
For Each doc As Document In oDoc.AllReferencedDocuments
On Error Resume Next
oRule = iLogicAuto.GetRule(doc, oRuleName)
iLogicAuto.RunRuleDirect(oRule)
Next