Hi All,
I have a routine that runs dview with clipping planes and then also runs the section command. The regional entities created by the sectionsolid command are then moved to an individual dynamically named and sequentially numbered layer. I have tried creating a selection set, for each Ent in thisdrawing.paperspace and few others.
Dim sHandle As String
Dim itm As AcadObject
Dim SkipPortHandle As String
Dim testvp As AcadViewports
Dim ActLayout As AcadLayout
Dim DOC As AcadDocument
Set ActLayout = thisdrawing.ActiveLayout
thisdrawing.ActiveSpace = acPaperSpace
thisdrawing.MSpace = True
Dim pviewportObj2 As AcadPViewport
Dim testvp2 As AcadPViewport
Dim currView As AcadPViewport
Dim testvp3 As AcadPViewport
'gets the viewport handle
On Error Resume Next
Set ssetObj = thisdrawing.SelectionSets.Add("prev")
On Error GoTo 0
ssetObj.Select acSelectionSetPrevious
thisdrawing.ActivePViewport = thisdrawing.ActivePViewport
SkipPortHandle = thisdrawing.ActivePViewport.Handle
'gets all the layout names
Dim Layouts As AcadLayouts, Layout As AcadLayout
Dim LayoutName2 As AcadLayout
Set Layouts = thisdrawing.Layouts
thisdrawing.MSpace = False
For Each Layout In Layouts
If Layout.Name <> "Model" Then
ZoomAll
thisdrawing.ActiveLayout = Layout
ZoomAll
'ssetObj.Clear
'ssetObj.Select acSelectionSetAll
'For Each Ent In ssetObj
For Each Ent In thisdrawing.PaperSpace
If LCase(Ent.ObjectName) = "acdbviewport" Then
If Ent.Handle <> SkipPortHandle Then
ZoomAll
If LCase(Ent.Layer) = "vports" Then
sHandle = Ent.Handle
Set itm = thisdrawing.HandleToObject(sHandle)
ZoomAll
Set currView = itm
thisdrawing.MSpace = True
thisdrawing.ActivePViewport = currView
thisdrawing.SendCommand "vplayer" & " " & "f" & " " & layername2 _
& vbCr & "current" & vbCr & vbCr
currView.Update
End If
End If
End If
Next
End If
Next
On Error GoTo 0
thisdrawing.ActiveLayout = ActLayout
thisdrawing.MSpace = True
thisdrawing.ActivePViewport = thisdrawing.HandleToObject(SkipPortHandle)
thisdrawing.SendCommand "vplayer" & " " & "t" & " " & layername2 _
& vbCr & "current" & vbCr & vbCr
thisdrawing.SendCommand "pspace" & vbCr
thisdrawing.Regen acAllViewports
In the code above, anytime it hits any RText in paperspace it give a class error. This is a known issue to Autodesk.
Any suggestions on how to get around this? I like using RText and do not want to have to add it later or ask my customers to do that either.
Thank you,
David Wishengrad
MillLister, Inc.
PS. Alex posted this site on Woodweb, so I thought I would check it out. I still do not understand why he is not a customer yet.
I do not really know exactly what he does and many detailiers do not have a choice of what software they use. If you read this Alex, give me a call when you get a chance. You are a pretty smart dude. I would like to undestand what your needs are.