Author Topic: what layers are frozen in what viewport/layout tabs  (Read 6088 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
what layers are frozen in what viewport/layout tabs
« on: August 26, 2008, 09:53:54 AM »
In one of our templates we have about 12 layout tabs with a single viewport on each. Each viewport on the different layouts has specific layers frozen within it. I need to generate a report that will show me what layers are frozen in each viewport/layout tab. Right now I only have a single viewport per layout but I may have more later and would like to run the same type check but I'll keep it simple for starters. Anyone have something like this?

ronjonp

  • Needs a day job
  • Posts: 7524
Re: what layers are frozen in what viewport/layout tabs
« Reply #1 on: August 26, 2008, 11:31:17 AM »
This might do what you need:

Code: [Select]
(defun c:test (/ a b c el ll ss)
  (if (setq ss (ssget "x" '((0 . "VIEWPORT"))))
    (foreach e (mapcar 'cadr (ssnamex ss))
      ;;CABS pspace vport filter
      (setq a (cdr (assoc 330 (entget e)))
    b (cdr (assoc 340 (entget a)))
    c (cdr (assoc 331 (entget b)))
      )
      (if (and (not (equal c e))
       (setq el (entget e))
       (member 331 (mapcar 'car el))
  )
(foreach i el
  (if (and (= (car i) 331)
   (setq ll (entget (cdr i)))
   (= (cdr (assoc 0 ll)) "LAYER")
      )
    (princ (strcat "\nLayer "
   (cdr (assoc 2 ll))
   " controlled in vport on layout "
   (cdr (assoc 410 el))
   )
    )
  )
)
      )
    )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Patrick_35

  • Guest
Re: what layers are frozen in what viewport/layout tabs
« Reply #2 on: August 26, 2008, 11:32:32 AM »
Hi

With at ?

@+

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: what layers are frozen in what viewport/layout tabs
« Reply #3 on: August 26, 2008, 12:50:15 PM »
Nice one Ron.
Here is a variation of your routine.
Code: [Select]
;;  By ronjonp modified by CAB
;;  Reports all the frozen layers in each VP by layouts
(defun c:VPFrzReport (/ a b c el ll ss dxfvpcode ln lastln id lastid)
  ;;  Not sure of the exact version when this changed
  (if (> (rtos(atof(getvar "ACADVER"))2 2) "15.00")
    (SETQ dxfvpcode 331) ; for ACAD >2000
    (SETQ dxfvpcode 341)
  )
 
  (if (setq ss (ssget "x" '((0 . "VIEWPORT"))))
    (foreach e (mapcar 'cadr (ssnamex ss))
      ;;CABS pspace vport filter
      (setq a (cdr (assoc 330 (entget e)))
    b (cdr (assoc 340 (entget a)))
    c (cdr (assoc dxfvpcode (entget b)))
            ln (cdr (assoc 410 (entget e)))
            id (cdr (assoc 69 (entget e)))
      )
      (if (or (null lastln ) (/= ln lastln))
        (progn
          (setq lastln ln)
          (princ (strcat "\nLayout " ln " ----------"))
        )
      )
      (if (or (null lastid ) (/= id lastid))
        (progn
          (setq lastid id)
          (princ (strcat "\n  VP ID# " (itoa id) " ......."))
        )
      )
      (if (and (not (equal c e))
       (setq el (entget e))
       (or (member dxfvpcode (mapcar 'car el))
                   (prompt "\n    No Frozen Layers"))
  )
(foreach i el
  (if (and (= (car i) dxfvpcode)
   (setq ll (entget (cdr i)))
   (= (cdr (assoc 0 ll)) "LAYER")
      )
    (princ (strcat "\n    Layer "
   (cdr (assoc 2 ll))
   " controlled in vport on layout "
   (cdr (assoc 410 el))
   )
    )
  )
)
      )
    )
  )
  (princ)
)

<edit: updated code>
« Last Edit: August 27, 2008, 12:46:35 PM by CAB »
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7524
Re: what layers are frozen in what viewport/layout tabs
« Reply #4 on: August 26, 2008, 12:56:52 PM »
Nice CAB...I like the output much better.

So you're still gonna help Dan after he dissed your beer?  :roll:

 :-)
« Last Edit: August 26, 2008, 01:27:36 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: what layers are frozen in what viewport/layout tabs
« Reply #5 on: August 26, 2008, 01:24:19 PM »
Thanks for the reminder, I should pull the code. :evil:
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
Re: what layers are frozen in what viewport/layout tabs
« Reply #6 on: August 27, 2008, 10:36:48 AM »
woah hey wow, i can feel the love in the room. I will test out and let you know. Thanks for all the responses.

ELOQUINTET

  • Guest
Re: what layers are frozen in what viewport/layout tabs
« Reply #7 on: August 27, 2008, 10:42:25 AM »
uh where does it save the report. i was thinking it would put it in the directory that the drawing was in but it doesn't appear there. what am i missing?

ronjonp

  • Needs a day job
  • Posts: 7524
Re: what layers are frozen in what viewport/layout tabs
« Reply #8 on: August 27, 2008, 10:46:15 AM »
Look at your command line Dan.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ELOQUINTET

  • Guest
Re: what layers are frozen in what viewport/layout tabs
« Reply #9 on: August 27, 2008, 10:55:52 AM »
I looked at it but not sure what to make of it.
I am looking for a list of the layer names and am not seeing that?

Layout 01-NOTE ----------
  VP ID# 1 .......
Layout 02-KEY ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 03-EXST ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 04-DEMO-C ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 05-DEMO-F ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 06-NEW ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 07-FIXT ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 08-DECO ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 09-ELEC ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 10-CLNG ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout 11-ELEV-1 ----------
  VP ID# 2 .......
  VP ID# 1 .......
Layout SYMBOLS ----------
  VP ID# 0 .......

ronjonp

  • Needs a day job
  • Posts: 7524
Re: what layers are frozen in what viewport/layout tabs
« Reply #10 on: August 27, 2008, 11:29:21 AM »
That means there are no viewport layer overrides.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: what layers are frozen in what viewport/layout tabs
« Reply #11 on: August 27, 2008, 12:47:39 PM »
Just updated the code to print the message if no layers are frozen.

PS only reports on FROZEN in VP layers
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
Re: what layers are frozen in what viewport/layout tabs
« Reply #12 on: August 27, 2008, 01:31:07 PM »
I'm not sure we understand eachother so I'm attaching the file I'm running this on. When you click in the viewport on layout 2-11 and look in the layers dialog you will see that different layers are frozen per layout. These layer names are what I want to be reported.

ELOQUINTET

  • Guest
Re: what layers are frozen in what viewport/layout tabs
« Reply #13 on: August 27, 2008, 01:34:01 PM »
does it have something to do with the layer that the viewport is on being frozen?

ronjonp

  • Needs a day job
  • Posts: 7524
Re: what layers are frozen in what viewport/layout tabs
« Reply #14 on: August 27, 2008, 01:34:38 PM »
does it have something to do with the layer that the viewport is on being frozen?

Your drawing works fine here:

Quote
C:VPFRZREPORT
Layout 01-NOTE ----------
  VP ID# 1 .......
Layout 02-KEY ----------
  VP ID# 2 .......
    Layer z-viewport controlled in vport on layout 02-KEY
    Layer i-new-wall-patt controlled in vport on layout 02-KEY
    Layer i-exst-sqft-chrg controlled in vport on layout 02-KEY
    Layer i-exst-sqft-new controlled in vport on layout 02-KEY
    Layer i-exst-sqft-reno controlled in vport on layout 02-KEY
    Layer i-exst-sqft-exst controlled in vport on layout 02-KEY
    Layer i-exst-sqft-incr controlled in vport on layout 02-KEY
    Layer i-elec_symb controlled in vport on layout 02-KEY
    Layer i-new-wall controlled in vport on layout 02-KEY
  VP ID# 1 .......
Layout 03-EXST ----------
  VP ID# 0 .......
    Layer z-viewport controlled in vport on layout 03-EXST
Layout 04-DEMO-C ----------
    Layer z-viewport controlled in vport on layout 04-DEMO-C
    Layer i-new-wall-patt controlled in vport on layout 04-DEMO-C
    Layer i-key-patt controlled in vport on layout 04-DEMO-C
    Layer i-exst-sqft-chrg controlled in vport on layout 04-DEMO-C
    Layer i-exst-sqft-new controlled in vport on layout 04-DEMO-C
    Layer i-exst-sqft-reno controlled in vport on layout 04-DEMO-C
    Layer i-exst-sqft-exst controlled in vport on layout 04-DEMO-C
    Layer i-exst-sqft-incr controlled in vport on layout 04-DEMO-C
    Layer i-elec_symb controlled in vport on layout 04-DEMO-C
    Layer i-new-wall controlled in vport on layout 04-DEMO-C
Layout 05-DEMO-F ----------
    Layer z-viewport controlled in vport on layout 05-DEMO-F
    Layer i-new-wall-patt controlled in vport on layout 05-DEMO-F
    Layer i-key-patt controlled in vport on layout 05-DEMO-F
    Layer i-exst-sqft-chrg controlled in vport on layout 05-DEMO-F
    Layer i-exst-sqft-new controlled in vport on layout 05-DEMO-F
    Layer i-exst-sqft-reno controlled in vport on layout 05-DEMO-F
    Layer i-exst-sqft-exst controlled in vport on layout 05-DEMO-F
    Layer i-exst-sqft-incr controlled in vport on layout 05-DEMO-F
    Layer i-elec_symb controlled in vport on layout 05-DEMO-F
    Layer i-new-wall controlled in vport on layout 05-DEMO-F
Layout 06-NEW ----------
    Layer z-viewport controlled in vport on layout 06-NEW
    Layer i-key-patt controlled in vport on layout 06-NEW
    Layer i-exst-sqft-chrg controlled in vport on layout 06-NEW
    Layer i-exst-sqft-new controlled in vport on layout 06-NEW
    Layer i-exst-sqft-reno controlled in vport on layout 06-NEW
    Layer i-exst-sqft-exst controlled in vport on layout 06-NEW
    Layer i-exst-sqft-incr controlled in vport on layout 06-NEW
    Layer i-elec_symb controlled in vport on layout 06-NEW
Layout 07-FIXT ----------
    Layer z-viewport controlled in vport on layout 07-FIXT
    Layer i-new-wall-patt controlled in vport on layout 07-FIXT
    Layer i-key-patt controlled in vport on layout 07-FIXT
    Layer i-exst-sqft-chrg controlled in vport on layout 07-FIXT
    Layer i-exst-sqft-new controlled in vport on layout 07-FIXT
    Layer i-exst-sqft-reno controlled in vport on layout 07-FIXT
    Layer i-exst-sqft-exst controlled in vport on layout 07-FIXT
    Layer i-exst-sqft-incr controlled in vport on layout 07-FIXT
    Layer i-elec_symb controlled in vport on layout 07-FIXT
Layout 08-DECO ----------
    Layer z-viewport controlled in vport on layout 08-DECO
    Layer i-new-wall-patt controlled in vport on layout 08-DECO
    Layer i-key-patt controlled in vport on layout 08-DECO
    Layer i-exst-sqft-chrg controlled in vport on layout 08-DECO
    Layer i-exst-sqft-new controlled in vport on layout 08-DECO
    Layer i-exst-sqft-reno controlled in vport on layout 08-DECO
    Layer i-exst-sqft-exst controlled in vport on layout 08-DECO
    Layer i-exst-sqft-incr controlled in vport on layout 08-DECO
    Layer i-elec_symb controlled in vport on layout 08-DECO
Layout 09-ELEC ----------
    Layer z-viewport controlled in vport on layout 09-ELEC
    Layer i-key-patt controlled in vport on layout 09-ELEC
    Layer i-exst-sqft-chrg controlled in vport on layout 09-ELEC
    Layer i-exst-sqft-new controlled in vport on layout 09-ELEC
    Layer i-exst-sqft-reno controlled in vport on layout 09-ELEC
    Layer i-exst-sqft-exst controlled in vport on layout 09-ELEC
    Layer i-exst-sqft-incr controlled in vport on layout 09-ELEC
Layout 10-CLNG ----------
    Layer z-viewport controlled in vport on layout 10-CLNG
    Layer i-new-wall-patt controlled in vport on layout 10-CLNG
    Layer i-key-patt controlled in vport on layout 10-CLNG
    Layer i-exst-sqft-chrg controlled in vport on layout 10-CLNG
    Layer i-exst-sqft-new controlled in vport on layout 10-CLNG
    Layer i-exst-sqft-reno controlled in vport on layout 10-CLNG
    Layer i-exst-sqft-exst controlled in vport on layout 10-CLNG
    Layer i-exst-sqft-incr controlled in vport on layout 10-CLNG
    Layer i-elec_symb controlled in vport on layout 10-CLNG
Layout 11-ELEV-1 ----------
    Layer z-viewport controlled in vport on layout 11-ELEV-1
Layout SYMBOLS ----------

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC