Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISOLATE A LAYER in 2002 2

Status
Not open for further replies.

johnhan76

Civil/Environmental
May 16, 2002
123
0
0
US
I am using autocad 2002. I want to click on an object and make all of the layers other than the object's layer freeze. Does anyone know how to do this or do I need to buy an extension?
 
Replies continue below

Recommended for you

I use this lisp routine , It is not mine.



;|Finds layer of selected object, isolates it by Freezing, and zooms to (0.9) extents.
User clicks OK when finished and drawings returns to original view.
LAYER FLASH ROUTINE|;

(defun C:frezee (/ Flay lay Oldlay ITWAS OLDCMD WAITHERE XZ)
(vl-load-com)
(setq OldCmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq OldLay (getvar "CLAYER"))
(setq Flay (entsel "\nSelect object on FREEZE layer : "))
(setq XZ
(vla-get-layer
(vlax-ename->vla-object
(car Flay)
) ;_ end of vlax-ename->vla-object
) ;_ end of vla-get-layer
) ;_ end of setq
(command "undo" "begin")
(command "layer" "make" XZ "")
(command "-layer" "freeze" "*" "")
(command "zoom" "extents")
(command "Zoom" "0.9x")


;(setvar "clayer" Oldlay)
;(setvar "cmdecho" OldCmd)
(princ)

) ;_ end of defun


Pardal
 
Create custom icon and use this Diesel string

^C^C_ai_molc;\_-layer;_off;*;;;

it turns all but selected layer off.
experiment with freeze but you may not be able to freeze the current layer, unless you change the "selected" to "current" first - can be done.
 
Status
Not open for further replies.
Back
Top