- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here I am back again, stuck on lack of information.
Maybe someone can direct me to the rabbithole that shows me what calls I can make to limit "Visible.Documents" to only open IDW files and not try to any open IAM or IPT files.
Here's the scenario:
I have a pile of IDW files open along with an assembly and some parts.
I'm running a rule that will only process IDW files, so when it tries to open an IAM or IPT file, it opens a DB with an error.
I want to prevent that error from poping up so the rule can continue processing files that are only IDWs.
I tried 'error handling' but to no avail.
So now I'm trying an 'If/Then/End If' statment.
But I can't figure out how to reach into 'VISIBLE.DOCUMENTS' to tell it to skip non-IDW files, or to only process IDW files.
Anyone in here able to direct me to some reading on what applies to 'Visible.Documents'?
Here's the code in question (don't recall where I picked it up, but it works very well):
' This rule runs the below rule on all open parts
Dim addIn As ApplicationAddIn
Dim addIns As ApplicationAddIns = ThisApplication.ApplicationAddIns
Dim iLogicAuto
For Each addIn In addIns
If InStr(addIn.DisplayName, "iLogic") > 0 Then
iLogicAuto = addIn.Automation
Exit For
End If
Next
For Each oDoc As Document In ThisApplication.Documents.VisibleDocuments
oDoc.Activate()
iLogicAuto.RunExternalRule(oDoc, "rule_filename")
Next
'This is what I tried but failed:
'For Each oDoc As Document In ThisApplication.Documents.VisibleDocuments
' If oDoc.PropertySets.Item("Design Tracking Properties").Item("Document SubType Name").Value = "Sheet Metal" Then
' oDoc.Activate() 'This is the added code that doesn't work
' iLogicAuto.RunExternalRule(oDoc, "rule_filename")
' End If
'Next
Thanx...
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
Solved! Go to Solution.