Author Topic: Viewport ID 1 - Invisible  (Read 812 times)

0 Members and 1 Guest are viewing this topic.

Matthew H

  • Newt
  • Posts: 70
Viewport ID 1 - Invisible
« on: August 19, 2022, 03:16:47 PM »
Does anyone have any insight or knowledge regarding viewport's with an ID of 1 (dotted pairs dxf group code 69)?
It is in every layout tab, it can not be deleted, it cannot be selected via grips, though it can have its attributes changed via the properties panel.
Also this viewport will resize itself to the current drawing window area after every command. Note, if you modify its attributed via the properties panel, it will no longer resize itself.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:test (/ ss )
  2.  
  3. (setq ss (ssget "_X" '((0 . "VIEWPORT") (-4 . "=") (69 . 1))))
  4.  
  5.         ;select selection set "ss"
  6.         (sssetfirst nil)
  7.         (command "_.select" ss "")
  8.         (sssetfirst nil (ssget "_P"))
  9. )


Additionally why is a drawing's database empty when created from acad.dwt?

Quote
Running the below command in a brand new drawing created from the default acad.dwt will return an empty selection set.
Code - Auto/Visual Lisp: [Select]
  1. (setq ss (ssget "_X" ))
This does not make much sense, as by default a drawing created from acad.dwt has the following items:
Quote
0 Entities in "Model"
1 Viewport in "Layout1"
1 Viewport in "Layout2"
Though, once each "layout tab" has been activated/viewed, the viewports will be included in the database. Use the below command to activate/view each tab.
Code - Auto/Visual Lisp: [Select]
  1. (foreach tab (layoutlist) (command "ctab" tab))


Thanks in advance,
Matthew H.
« Last Edit: August 19, 2022, 03:20:06 PM by Matthew H »

mhupp

  • Bull Frog
  • Posts: 250
Re: Viewport ID 1 - Invisible
« Reply #1 on: August 19, 2022, 07:33:24 PM »
Its the paper space itself. you can check with system variable cvport.  Model space is always 2 or higher.

This will zoom extents all layouts in paper space. regardless if you left a view port active or not.
Code - Auto/Visual Lisp: [Select]
  1. ;;----------------------------------------------------------------------------;;
  2. ;; Zoom Extents all tabs
  3. (defun C:ZA (/ lyt)
  4.   (setq lyt (getvar 'ctab))
  5.     (setvar 'ctab lay)
  6.     (setvar 'cvport 1)  ;change to paper space
  7.     ;(vl-cmdf "_.Zoom" "E")
  8.   )
  9.   (setvar 'ctab lyt)
  10. )
« Last Edit: August 19, 2022, 08:06:23 PM by mhupp »