08-13-2019
01:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-13-2019
01:24 AM
Hello Martin,
Replace IColor() with the following :
Sub IColor()
Dim doc As AssemblyDocument
Dim designView As DesignViewRepresentation
Dim viewFound As Boolean
Dim repManager As RepresentationsManager
Set doc = ThisApplication.ActiveDocument
Set repManager = doc.ComponentDefinition.RepresentationsManager
viewFound = False
For Each designView In repManager.DesignViewRepresentations
If designView.Name = "IColor" Then
viewFound = True
Exit For
End If
Next
If Not viewFound Then
Set designView = repManager.DesignViewRepresentations.Add("IColor")
End If
designView.Activate
Dim occ As ComponentOccurrence
Dim occ2 As ComponentOccurrence
Dim index As Integer
Dim index2 As Integer
Dim localAsset As Asset
Dim colorIndex As Integer
colorIndex = 0
For index = 1 To doc.ComponentDefinition.Occurrences.Count
Set occ = doc.ComponentDefinition.Occurrences(index)
If Left(occ.Appearance.DisplayName, 6) <> "IColor" Then
Set localAsset = GetAsset(doc, colorIndex)
For index2 = index To doc.ComponentDefinition.Occurrences.Count
Set occ2 = doc.ComponentDefinition.Occurrences(index2)
If occ.Definition Is occ2.Definition Then
occ2.Appearance = localAsset
End If
Next index2
colorIndex = (colorIndex + 1) And 15
End If
Next index
End SubDoes this work fine?
=====
Freeradical
Hideo Yamada