Author Topic: Retrieve PS viewport status in VL?  (Read 2218 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Retrieve PS viewport status in VL?
« 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.

hermanm

  • Guest
Re: Retrieve PS viewport status in VL?
« Reply #1 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.


roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Retrieve PS viewport status in VL?
« Reply #2 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.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Retrieve PS viewport status in VL?
« Reply #3 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...

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Retrieve PS viewport status in VL?
« Reply #4 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.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Retrieve PS viewport status in VL?
« Reply #5 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!

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Retrieve PS viewport status in VL?
« Reply #6 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!  :-)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Retrieve PS viewport status in VL?
« Reply #7 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.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst