- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey
from assembly level, i am trying to assign a material with its associated appearance. I am first clearing the part level appearance override as its been set in a file conversion.
Dim asmDoc As AssemblyDocument = FrmModelLoader._invApp.ActiveDocument
Dim doc As Document
For Each doc In asmDoc.AllReferencedDocuments
If doc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
Dim Part As PartDocument = doc
Dim p As PartComponentDefinition = Part.ComponentDefinition
p.ClearAppearanceOverrides()
asmDoc.Rebuild2()
End If
Next
End Sub
While i doing this, i need to assign a material from a library (it should already be accessible from the part). I can assign the material but it doesnt assign the associated appearance. When i do it manually, it does.
Do i need to assign the appearance separately if assigning by code? If so, what is the best way to do that? All of the posts i found were either too old (predating Assets) or showing me how to get the materials into a text file...
Summary
From assembly level, i need to
loop assembly
for each part, clear appearance
assign a material
assign an appearance
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Solved! Go to Solution.