01-23-2019
10:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-23-2019
10:38 AM
Here's a script that does what I described. In my basic test it was pretty snappy (at least faster than if you didn't turn screen updating off). It also rolls all of the view rep changes into a single undo transaction and then aborts it. So rather than leaving an undo entry for every design view switch, it leaves no undo entries at all.
Still not ideal, but will hopefully work for you. I'm as curious as you if there's a way to query the view reps directly without activating them.
Dim oAssyDoc As AssemblyDocument = ThisDoc.Document
Dim oCompDef As AssemblyComponentDefinition = oAssyDoc.ComponentDefinition
Dim oRepMan As RepresentationsManager = oCompDef.RepresentationsManager
Dim oCurView As DesignViewRepresentation = oRepMan.ActiveDesignViewRepresentation
Dim oList As New List(Of String)
ThisApplication.ScreenUpdating = False
Dim oTransaction As Transaction = ThisApplication.TransactionManager.StartTransaction(oAssyDoc,"Check View Rep Transparency")
For Each oView As DesignViewRepresentation In oRepMan.DesignViewRepresentations
oView.Activate
For Each oOcc As ComponentOccurrence In oCompDef.Occurrences
If oOcc.Transparent Then
If Not oList.Contains("View: " & oView.Name) Then oList.Add("View: " & oView.Name)
oList.Add(vbTab & oOcc.Name)
End If
Next
Next
oCurView.Activate
oTransaction.Abort
ThisApplication.ScreenUpdating = True
MessageBox.Show(String.Join(vbCrLf,oList))