Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

It almost work I did have to delete 2 line of the code... but after that it look like it will work

 

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

 

Tags (1)