Unhide layera lsp

Unhide layera lsp

Isanders2
Explorer Explorer
610 Views
5 Replies
Message 1 of 6

Unhide layera lsp

Isanders2
Explorer
Explorer

Hey in trying to find a code that does what is explained on this website https://cadtips.cadalyst.com/layer-properties/unhide-layers for some reason I am unable to download it was wondering if anyone used sonething like this

0 Likes
Accepted solutions (2)
611 Views
5 Replies
Replies (5)
Message 2 of 6

Patchy
Mentor
Mentor
Accepted solution

This one?

0 Likes
Message 3 of 6

pendean
Community Legend
Community Legend
Accepted solution

here you go (untested, I had it in a backup)

 

 


;;;========================================================================
;;;                    *** LYR-UNHIDE.LSP ***
;;;========================================================================
;;;
;;; This function dynamicaly "TURN ON" frozen layers by selecting objects
;;; lying on these layers. The procedure is achieved by temporary turning
;;; on all layers to enable selection.
;;;
;;;
;;; "Specially recommanded to use on Xrefs" - Raymond Rizkallah, Aug. 2007
;;;========================================================================

(defun C:LUH (/ entsll laynam laypmt  )

  (setq orgm (getvar "regenmode"))
  (setq laylst nil laypmt " ")
  (command "undo" "m" "undo" "g")

    (setvar "regenmode" 1)
  (command "layer" "t" "*" "on" "*" "")
  (while
    (setq entsll (nentsel "\n Select object on layer to be unhidden: "))
    (setq laynam (cdr (assoc 8 (entget (car entsll)))))
    (if (null laylst) (setq laylst (strcat laynam ",")) (setq laylst (strcat laylst laynam ",")))
    ;(prompt (strcat "\n   <" (substr laylst 1 (1- (strlen laylst))) ">"))

    (setq laypmt (strcat laypmt "<" laynam "> ; "))    (prompt (strcat "\n" laypmt))

  ) ;end while

  ; (command "undo" "end" "undo" "1")   
  (if laylst (command "layer" "t" laylst "on" laylst "u" laylst ""))  ;end if
 
  (setvar "regenmode" orgm)
  (princ)

) ;end function

;;;========================================================================

(prompt "\n Use [C:LUH] to dynamicaly reveal hidden layers. ")
(princ)

 

 

 

0 Likes
Message 4 of 6

Isanders2
Explorer
Explorer

Thanks will take a look at it

0 Likes
Message 5 of 6

Isanders2
Explorer
Explorer

Thank you

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

My approach to this was in LayerThawOnSelect.lsp and its LTOS command, >here<.

Two meaningful differences [there could be other lesser ones]:

1.  It's top-level, not for nested objects' Layers [it could probably be made to do them, but I think you could likely be thawing/turning-on Layer 0 multiple times].

2.  It thaws/turns on everything, and it highlights everything on Layers that were initially frozen or off, so you can see which they were and won't unnecessarily select things on Layers that were already visible before you started.  And once you pick something, it un-highlights everything else on that Layer, so you won't be selecting something else on a Layer you've already picked.

Kent Cooper, AIA