Author Topic: Layouts and Layer Freeze and ON OFF  (Read 5461 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Layouts and Layer Freeze and ON OFF
« on: December 09, 2004, 10:35:30 AM »
I have a dwg with eveything i need in it... Layers etc.
Question is I want to create 2 different dwgs in the same dwg without using a express layer manager to CHANGE it manually. I want it to change automatically when i switch to the layout tab of my choice...

Is this possible?!

thanks
Civil3D 2020

CADaver

  • Guest
Re: Layouts and Layer Freeze and ON OFF
« Reply #1 on: December 09, 2004, 11:41:02 AM »
Quote from: MSTG007
I have a dwg with eveything i need in it... Layers etc.
Question is I want to create 2 different dwgs in the same dwg without using a express layer manager to CHANGE it manually. I want it to change automatically when i switch to the layout tab of my choice...

Is this possible?!

thanks
Let me make sure I understand.  Are you attempting to create additional FILES or LAYOUTS?

If it's files, you can use SAVEAS, or use the original file as a "template".  To do the later in R2002, NEW->Use Template->Browse-> <in the file name window, key-in *.dwg> <then find the desired drawing.  A new file will be created using the old as a prototype.

If it's layouts in the same file, right click on the layout tab and use "Move or Copy".  Be sure to click the box next to "Make Copy"

You can also import layouts from other drawings. By right clicking on the layout tab, then select "From Template".  In that dialog box at the bottom, you can change "files of type"

Also from the Express tools LMAN, you can export layer settings.

I think, one of the threads on this forum has an excellent layer export/import tool.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Layouts and Layer Freeze and ON OFF
« Reply #2 on: December 09, 2004, 11:45:56 AM »
BUT AS we know... there is no way that it can automatically change to what ever layers that need to be shown once the other layout has been clicked and viewed.

I do know if everything is in a VP... cant i just use current viewport freeze and thaw?
Civil3D 2020

CADaver

  • Guest
Layouts and Layer Freeze and ON OFF
« Reply #3 on: December 09, 2004, 12:04:13 PM »
Quote from: MSTG007
BUT AS we know... there is no way that it can automatically change to what ever layers that need to be shown once the other layout has been clicked and viewed.

I do know if everything is in a VP... cant i just use current viewport freeze and thaw?
I'm not sure what you mean.  
Each viewport will retain the Freeze/Thaw Status of layers that have been Frozen/Thawed in that viewport using VPLAYER or the "Current VP Freeze" Column in the Layer Manager.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Layouts and Layer Freeze and ON OFF
« Reply #4 on: December 09, 2004, 12:45:24 PM »
mstg007,
I'm confused as to what you actually want to do.
Take a look at this drawing and see if this is what you are trying to do.
http://theswamp.org/lilly_pond/cab/Morrison%201.zip?nossi=1
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.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Layouts and Layer Freeze and ON OFF
« Reply #5 on: December 20, 2004, 03:26:00 PM »
CAB this is good... But can this also change colors when i change the tabs / layouts?
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Layouts and Layer Freeze and ON OFF
« Reply #6 on: December 20, 2004, 03:52:22 PM »
Not that I am aware, You could use the layer manager to change that type of layer info.
It would not be tied to a particular tab. I suppose you could use a 'Tab Reactor' to switch
to a different layer State.
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.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Layouts and Layer Freeze and ON OFF
« Reply #7 on: December 21, 2004, 07:26:38 AM »
Now... is that something that is already in acad? or something that needs to be created.......
Civil3D 2020

DanB

  • Bull Frog
  • Posts: 367
Layouts and Layer Freeze and ON OFF
« Reply #8 on: December 21, 2004, 12:39:44 PM »
I have a "Tab Reactor" type code that will activate a Layer state if it is named the same as the Tab/Layout. I don't remember how to get into the Lily Pond to upload this file though.....

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Layouts and Layer Freeze and ON OFF
« Reply #9 on: December 21, 2004, 12:49:27 PM »
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.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Layouts and Layer Freeze and ON OFF
« Reply #10 on: December 21, 2004, 12:52:00 PM »
you rock CAB
Civil3D 2020

CADaver

  • Guest
Layouts and Layer Freeze and ON OFF
« Reply #11 on: December 21, 2004, 01:08:08 PM »
Okay I'm confused.  How is this something that is not controlled by the layer visibility in each viewport?  The only thing I have in PS on the layouts is annotation.  From another thread I see most even place annotation in the model.  So what layers need to be controlled with a reactor from tab to tab???

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Layouts and Layer Freeze and ON OFF
« Reply #12 on: December 21, 2004, 01:23:28 PM »
You're not the only one.
From what I see there may be tabs where the layers of certain objects need to be one
color and other tabs where that need to be something else. So to avoid drawing two
sets of objects with different colors you could use the 'Layer State' to switch the
colors of just one set of objects. Using a Tab Reactor to change the layer state when you
activate that tab. Not sure I would want to do it with reactors though. I could just
change the layer state manually.
In my case there are times when I want to create a demolition plan where some of the
walls need to be screened. In other tabs the same walls may need to be solid. I use a separate
Layer State to control this. With a reactor it could be automatic but the routine would
have to be able to identify the tab and the layer states created.
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Layouts and Layer Freeze and ON OFF
« Reply #13 on: December 21, 2004, 01:28:51 PM »
Some time back I was fooling around with Tab Reactors for someone but can't find the old post.
Here is the code that i kept. It may be a starting place.
It did what were are talking about here but is set up for that user.
Code: [Select]
;;;          TabReactor.lsp by Charles Alan Butler        
;;;
;;;  This routine uses a collection sub functions gathered
;;;  from various web sites
;;;
;;;   Tested in ACAD 2004 only
;;;
;; ===============================================================
;;            Place in acaddoc.lsp
;; ===============================================================
(vl-load-com)
(if (not *layoutswitch*)
  (setq *layoutswitch*
(vlr-miscellaneous-reactor
  nil
  '((:vlr-layoutswitched
     .
     layoutswitched
    )
   )
)
  )
)


;; ===============================================================
;;                   Main function                                
;; ===============================================================
(defun layoutswitched (reactor layout / cur_tab Tab_list lay)
  ;;  create a list of tabs & layers
  (setq cur_tab (nth 0 layout)
tab_list (list
  (cons "Z1-A1 plprA" "plprA")
  (cons "Z1-A2 plprA" "plprA")
  (cons "Z1-B plprB" "plprB")
  (cons "Z1-C1 plprC" "plprC")
  (cons "Z1-C2 plprC" "plprC")
)
  )
  (prompt (strcat "\nLayout tab switched to:" cur_tab))
  (if (setq lay (strcase(cdr (assoc cur_tab tab_list))))
    (progn ; tab name is in list
      ;;  set layer state
      (if (member lay (get-statenames))
(progn ; layer state exist
 (restore-layerstate lay); change the state
 (prompt (strcat "\nSwitching to Layer State " lay "\n"))
); end progn
(alert (strcat "\nLayer State " lay " does not exist."))
      ); endif
    ) ; end progn
  ) ;endif

  (vla-regen (get-activedocument) 1)
  (princ)
); end defun layoutswitched
;; ===============================================================

;; ===============================================================
;;              Sub Routines                                      
;; ===============================================================
(defun get-acadobject  ()
  (setq *acad*
  (cond
    (*acad*)
    ((vlax-get-acad-object))
    (T nil))))

;; ===============================================================
(defun get-activedocument  ()
  (setq *doc*
  (cond
    (*doc*)
    ((vla-get-activedocument (get-acadobject)))
    (T nil))))

;; ===============================================================
(defun get-statenames  (/ collection names)
  (if (not (vl-catch-all-error-p
   (setq collection
     (vl-catch-all-apply
        (function (lambda ()
          (vla-item (vla-getextensiondictionary
            (vla-get-layers
              (get-activedocument)))
                "ACAD_LAYERSTATES")))))))
    (vlax-for item  collection
      (setq names (cons (strcase (vla-get-name item)) names)))))

;; ===============================================================
(defun restore-layerstate  (name)
  (if (and state
    (vl-position
      (strcase name)
      (get-statenames)))
    (progn (vla-restore state name)
    (delete-layerstate state name)
    (vlax-release-object state)
    (setq state nil)))
)

;; ===============================================================
(defun delete-layerstate  (obj name)
 (if (vl-catch-all-error-p
       (vl-catch-all-apply 'vla-delete (list obj name)))
    nil
    T)
)
;; ===============================================================
;;                      End of File                              
;; ===============================================================
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Layouts and Layer Freeze and ON OFF
« Reply #14 on: December 21, 2004, 02:05:09 PM »
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.