Hello all,
Right now my code will plot all P and L named views in a drawing (i.e. L1,
L2, etc.). However, I was able to populate a ListBox with the View names,
however, I cannot get the "names" of the selected items passed correctly to
my PlotView sub.
In UserForm Initialize to populate the ListBox (with Multiple selection
enabled) with the VIEW names:
For Each objView In objViews
strView = objView.Name
If strView Like "L#" Or strView Like "L##" Or strView Like "P#" Or
strView Like "P##" Then
lstViews.AddItem objView.Name
End If
Next objView
Button on the form calls this sub.
Public Sub PlotAllViews(pltMode As String)
Dim objView As AcadView
Dim objViews As AcadViews
Dim strView As String
Dim i As Integer
Set objViews = ThisDrawing.Views
For Each objView In objViews
strView = objView.Name
strView = Mid(strView, 2)
intView = Val(strView)
PlotView objView, pltMode
Next objView
End Sub
However, I am trying to work this code into the PlotAllViews sub, so that
ONLY the selected views in the ListBox are passed to the PlotView objView,
pltMode line. I don't need my L and P string check anymore because I am
doing that when the form initializes.
Dim i As Integer
If lstViews.ListIndex = -1 Then Exit Sub
For i = lstViews.ListCount - 1 To 0 Step -1
If lstViews.Selected(i) = True Then
Debug.Print lstViews.List(i)
End If
Next i