RemoveHiddenLines property in R14 VBA?

RemoveHiddenLines property in R14 VBA?

Anonymous
Not applicable
280 Views
4 Replies
Message 1 of 5

RemoveHiddenLines property in R14 VBA?

Anonymous
Not applicable
Hello all.
Is this PS viewport property read only?

I can get the property, but cannot seem to be able to set the property?
This sample code reads the value with no problem, but I cannot seem to
change the value?

Sub Example_RemoveHiddenLines()
Dim pviewportObj As AcadPViewport
Dim center(0 To 2) As Double, width As Double, height As Double
center(0) = 3: center(1) = 3: center(2) = 0
width = 40: height = 40
ThisDrawing.ActiveSpace = acPaperSpace
Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width,
height)
pviewportObj.Display True
Dim removeHidden As Boolean
removeHidden = pviewportObj.RemoveHiddenLines
MsgBox "The value of the RemoveHiddenLines property for the paperspace
viewport is " & pviewportObj.RemoveHiddenLines, ,
"RemoveHiddenLines Example"
End Sub

To set the value, I was trying:
pviewportObj.RemoveHiddenLines True
&
Set pviewportObj.RemoveHiddenLines=True

Neither worked. I am missing something simple, or is this a read only
value?

Warren Medernach
0 Likes
281 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
pviewportObj.RemoveHiddenLines=True

Joe

Warren Medernach wrote in message
news:88jqer$79d23@adesknews2.autodesk.com...
> Hello all.
> Is this PS viewport property read only?
>
> I can get the property, but cannot seem to be able to set the property?
> This sample code reads the value with no problem, but I cannot seem to
> change the value?
>
> Sub Example_RemoveHiddenLines()
> Dim pviewportObj As AcadPViewport
> Dim center(0 To 2) As Double, width As Double, height As Double
> center(0) = 3: center(1) = 3: center(2) = 0
> width = 40: height = 40
> ThisDrawing.ActiveSpace = acPaperSpace
> Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width,
> height)
> pviewportObj.Display True
> Dim removeHidden As Boolean
> removeHidden = pviewportObj.RemoveHiddenLines
> MsgBox "The value of the RemoveHiddenLines property for the paperspace
> viewport is " & pviewportObj.RemoveHiddenLines, ,
> "RemoveHiddenLines Example"
> End Sub
>
> To set the value, I was trying:
> pviewportObj.RemoveHiddenLines True
> &
> Set pviewportObj.RemoveHiddenLines=True
>
> Neither worked. I am missing something simple, or is this a read only
> value?
>
> Warren Medernach
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks Joe.
But when I try that it comes back with:

Run-time error '-2147352567 (80020009)':
Cannot change active viewport

Here is what I have.
I am passing it the appropriate variables

Sub AddPViewport(dblCenterPt As Variant, dblWidth As Double, dblHeight As
Double)
Dim pviewportObj As Object
Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(dblCenterPt,
dblWidth, dblHeight)
pviewportObj.Display True
pviewportObj.RemoveHiddenLines = True
End Sub

I just tried in 2000, and it works fine, but it will not work in R14.
I'm starting to think it's just plain broken in R14, I was hoping somebody
else could try it in R14.

Warren Medernach

"Joe Sutphin" wrote in message
news:88jvh4$79227@adesknews2.autodesk.com...
> pviewportObj.RemoveHiddenLines=True
>
> Joe
>
> Warren Medernach wrote in message
> news:88jqer$79d23@adesknews2.autodesk.com...
> > Hello all.
> > Is this PS viewport property read only?
> >
> > I can get the property, but cannot seem to be able to set the property?
> > This sample code reads the value with no problem, but I cannot seem to
> > change the value?
> >
> > Sub Example_RemoveHiddenLines()
> > Dim pviewportObj As AcadPViewport
> > Dim center(0 To 2) As Double, width As Double, height As Double
> > center(0) = 3: center(1) = 3: center(2) = 0
> > width = 40: height = 40
> > ThisDrawing.ActiveSpace = acPaperSpace
> > Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center,
width,
> > height)
> > pviewportObj.Display True
> > Dim removeHidden As Boolean
> > removeHidden = pviewportObj.RemoveHiddenLines
> > MsgBox "The value of the RemoveHiddenLines property for the
paperspace
> > viewport is " & pviewportObj.RemoveHiddenLines, ,
> > "RemoveHiddenLines Example"
> > End Sub
> >
> > To set the value, I was trying:
> > pviewportObj.RemoveHiddenLines True
> > &
> > Set pviewportObj.RemoveHiddenLines=True
> >
> > Neither worked. I am missing something simple, or is this a read only
> > value?
> >
> > Warren Medernach
> >
> >
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Warren,

In R14, first toggle the display control of the PViewport object off.

Private Sub remHiddenLines(pvp As AcadPViewport, bFlag As Boolean)
ThisDrawing.MSpace = False
pvp.Display False
pvp.RemoveHiddenLines = bFlag
End Sub

Denis
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thanks Denis!

Warren Medernach

"Denis Gagne" wrote in message
news:88km5n$c2u13@adesknews2.autodesk.com...
> Warren,
>
> In R14, first toggle the display control of the PViewport object off.
>
> Private Sub remHiddenLines(pvp As AcadPViewport, bFlag As Boolean)
> ThisDrawing.MSpace = False
> pvp.Display False
> pvp.RemoveHiddenLines = bFlag
> End Sub
>
> Denis
>
>
0 Likes