AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

I hope you don't mind me revising one of your routines to create another.
You helped me with one that makes a layer current by selecting an object from the screen. I revised it to turn off a layer by selecting an object. I removed (setvar "clayer" layername) and replaced it with (command "-layer" "off" layername"")

Kevin

------------------------------
; Layer-SF.lsp
;
; Turn off a layer by picking an object from the drawing
;
;CODING STARTS HERE
(defun C:Layer-SF ( / entity name layername)
(setq entity (car (entsel)))
(setq name (entget entity))
(setq layername (cdr (assoc 8 name)))
(command "-layer" "off" layername "")
(princ)
);defun
(princ)
;CODING ENDS HERE

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website