TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: roy_043 on March 03, 2015, 09:32:29 AM

Title: Retrieve PS viewport status in VL?
Post by: roy_043 on March 03, 2015, 09:32:29 AM
Is there a way to retrieve the PS viewport (AcDbViewport) status in Visual Lisp? I am looking for the VL equivalent of group code 68. I want to determine the active viewport on a layout in an objectdbx drawing.
Title: Re: Retrieve PS viewport status in VL?
Post by: hermanm on March 03, 2015, 12:43:49 PM
According to the object model,
Quote
ActivePViewport Property
 


Specifies the active paper space viewport for the drawing.

See Also | Example

Signature

object.ActivePViewport

object

Document
The object or objects this property applies to.

ActivePViewport

PViewport object; read-write
The active paper space viewport.

Title: Re: Retrieve PS viewport status in VL?
Post by: roy_043 on March 03, 2015, 02:12:58 PM
The ActivePViewport property is very close to what I need, thanks for pointing it out hermanm. The problem is that there is only one ActivePViewport for the entire document. What I am looking for is a way to identify the AcDbViewport that will become the ActivePViewport when you switch to a layout. These viewports have a group code 68 value of 1.

In 'classic' Lisp:
Code: [Select]
(sslength (ssget "_X" '((0 . "VIEWPORT") (68 . 1)))) => equals number of PS layouts.
Title: Re: Retrieve PS viewport status in VL?
Post by: roy_043 on March 03, 2015, 02:35:48 PM
The ViewportOn property of the AcDbViewport is another place to look. But it only holds the on/off 'part' of the group code 68 value...
Title: Re: Retrieve PS viewport status in VL?
Post by: Lee Mac on March 03, 2015, 02:38:28 PM
Is there a way to retrieve the PS viewport (AcDbViewport) status in Visual Lisp? I am looking for the VL equivalent of group code 68. I want to determine the active viewport on a layout in an objectdbx drawing.

The DXF data is usually still available through ObjectDBX; a quick test confirms this.
Title: Re: Retrieve PS viewport status in VL?
Post by: roy_043 on March 04, 2015, 02:44:21 AM
The DXF data is usually still available through ObjectDBX; a quick test confirms this.
I feel silly now. Somehow I made the assumption that (entget) would not work in an objectdbx context. Thank you very much Lee!
Title: Re: Retrieve PS viewport status in VL?
Post by: Lee Mac on March 04, 2015, 07:12:34 AM
The DXF data is usually still available through ObjectDBX; a quick test confirms this.
I feel silly now. Somehow I made the assumption that (entget) would not work in an objectdbx context. Thank you very much Lee!

No worries Roy!  :-)
Title: Re: Retrieve PS viewport status in VL?
Post by: MP on March 04, 2015, 07:43:37 AM
Using entget does work on ObjectDBX docs and has proven reliable. However, never, ever perform entmods or entupds on ObjectDBX docs. Instant dwg corruption. There was a discussion on this topic 10+ years ago.