10-14-2019
11:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-14-2019
11:44 PM
Actually, method AssemblyComponentDefinition.ClearAppearanceOverrides( [AppearanceOverrideObjects] As Variant ) would accept input parameter as object collection. Try below changes in your iLogic code.
Dim oAsmCompDef 'As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oViewReps As DesignViewRepresentations
oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations
'define view rep
Dim oViewRep As DesignViewRepresentation
Dim NumberOfView = oViewReps.Count
' get Manager of Representations
Dim dViewRepMgr As RepresentationsManager
dViewRepMgr = oAsmCompDef.RepresentationsManager
'Get active Representation View
Dim dViewRep As DesignViewRepresentation
dViewRep = dViewRepMgr.ActiveDesignViewRepresentation
For i = 1 To NumberOfView
If iProperties.Value("Custom", "Surface") = "Raw" Or iProperties.Value("Custom", "Surface") = "Galv." Or iProperties.Value("Custom", "Surface") = "Colour 1" Or iProperties.Value("Custom", "Surface") = "Colour 2" Or iProperties.Value("Custom", "Surface") = "RAL 5003" Or iProperties.Value("Custom", "Surface") = "RAL 9010" Or iProperties.Value("Custom", "Surface") = "RAL 1028" Or iProperties.Value("Custom", "Surface") = "RAL 9005" Or iProperties.Value("Custom", "Surface") = "EG-Galv" Or iProperties.Value("Custom", "Surface") = "HDG-Galv" Then
oViewReps.Item(i).Activate
End If
'---------------------
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAsmDoc.ComponentDefinition
Dim objColl As ObjectCollection
objColl = ThisApplication.TransientObjects.CreateObjectCollection
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
Call objColl.Add(oOccurrence)
iLogicVb.UpdateWhenDone = True
Next
oAsmCompDef.ClearAppearanceOverrides(objColl)
'-------------------------
iLogicVb.UpdateWhenDone = True
Next
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
