Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
fce
Enthusiast
1923 Views, 5 Replies

iLogic Appearance of all occurrences in an Assembly

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




Labels (1)