Message 1 of 6

Not applicable
09-13-2021
12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody,
I have a one iLogic rule for open all the drawings in Assembly. I try to implement one more check:
“If oRefDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kReferenceBOMStructure”.
This work great if I have defined BOM Structure in the Part. If I have defined BOM Structure in Assembly, this don‘t working.
Part of this rule I used for save as in pdf files. From this reason I need to open all the drawings just one time.
Maybe any have some solution for this?
With kind regards,
Jernej Puc
Sub Main() Dim oDoc As Document oDoc = ThisDoc.Document oDocName = System.IO.Path.GetDirectoryName(oDoc.FullFileName) & "\" & System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName) Dim oRefDoc As Document Dim oDrawDoc As DrawingDocument For Each oRefDoc In oDoc.AllReferencedDocuments oBaseName_suffix = System.IO.Path.GetFileName(oRefDoc.FullFileName) oBaseName = System.IO.Path.GetFileNameWithoutExtension(oRefDoc.FullFileName) oPathAndName_suffix = System.IO.Path.GetDirectoryName(oRefDoc.FullFileName) & "\" & oBaseName_suffix oPathAndName = System.IO.Path.GetDirectoryName(oRefDoc.FullFileName) & "\" & oBaseName If (System.IO.File.Exists(oPathAndName & ".idw")) Then oPartDoc = ThisApplication.Documents.Open(oPathAndName_suffix, False) ' If oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kNormalBOMStructure Or ' oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kInseparableBOMStructure Or ' oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure Then oDrawDoc = ThisApplication.Documents.Open(oPathAndName & ".idw", True) oDrawDoc.Close End If ' End If Next End Sub
Solved! Go to Solution.