- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there,
I would like to open each occurrence in an already open top assembly and get each appearance as a string.
I'm aware that the command "iProperties.PartColor" allows you to get the Appearance, but it's not working running from the top assembly. I'm probably just missing a simple function. Bellow you can find the code:
Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument oAsmName = ThisDoc.FileName(False) 'without extension Dim oRefDocs As DocumentsEnumerator oRefDocs = oAsmDoc.AllReferencedDocuments Dim oRefDoc As Document 'work the referenced models For Each oRefDoc In oRefDocs Dim oCurFile As Document oCurFile = ThisApplication.Documents.Open(oRefDoc.FullFileName, True) oCurFileAppearance = iProperties.PartColor 'oCurFileAppearance= oCurFile.Definition.Document.ActiveRenderStyle MessageBox.Show(oCurFileAppearance, "oCurFileAppearance") If oCurFileAppearance = "-" oCurFileAppearance ="-" End If ' MessageBox.Show(oCurFileAppearance, "oCurFileAppearance") oCurFile.Close Next
Solved! Go to Solution.