Message 1 of 3
Faster way to change lines on view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I currently have a rule that selects all the edges of a view and changes the layer to adjust the line thickness if the view is a shaded view. It works to do what I want it to do pretty well, but it takes a long time to run. Turning screen updating off doesn't seem to make it run much faster. Can anyone think of any improvements like being able to select all curves at the same time and batch layer change?
Sub Main()
On Error Resume Next
' ThisApplication.ScreenUpdating = False
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim olayers As LayersEnumerator
olayers = oDoc.StylesManager.layers
Dim VisXNarrow As Layer
VisXNarrow = olayers.Item("Visible Extra Narrow (ANSI)")
Dim oView As DrawingView
For Each oSheet In oDoc.Sheets
For Each oView In oSheet.DrawingViews
If oView.ViewStyle = kShadedDrawingViewStyle _
Or oView.ViewStyle = kShadedHiddenLineDrawingViewStyle Then
' Or oView.ViewStyle = kFromBaseDrawingViewStyle
Dim oCurves As DrawingCurvesEnumerator = oView.DrawingCurves()
Dim oCurve As DrawingCurve
For Each oCurve In oCurves
For i = 1 To oCurve.Segments.Count
oCurve.Segments.Item(i).Layer = VisXNarrow
Next
Next
End If
Next
Next
ThisApplication.ScreenUpdating = True
End Sub
Thanks.