Dear members..
Can anybody help me to make a lisp
which is help me to make some objects in one layer
Requiements are
* All dimensions to be change in to onle layer (layer name --- Dim, layer colour number 1)
*All leaders to be change in to onle layer (layer name --- Leader,layer colour number 1 )
*All text to be change in to onle layer (layer name --- Text ,layer colour number 3)
Thanks In advance for ur any reply....
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Perhaps something like this
(vl-load-com) (defun c:demo (/ adoc lay layers laylst locklst x) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (setq layers (vla-Get-Layers adoc)) (vlax-for lay layers (if (= (vla-get-lock lay) :vlax-true) (progn (setq locklst (cons (vla-get-name lay) locklst)) (vla-put-lock lay :vlax-false) ) ) ) (setq laylst '(("Dim" 1) ("Leader" 1) ("Text" 3))) (mapcar '(lambda (x) (setq lay (vla-add layers (car x))) (vla-put-color lay (cadr x)) ) laylst ) (vlax-for layt (vla-get-layouts adoc) (vlax-for blk (vla-get-block layt) (cond ((wcmatch (vla-get-objectname blk) "*Dimension*") (vla-put-layer blk "Dim") ) ((wcmatch (vla-get-objectname blk) "*Leader") (vla-put-layer blk "Leader") ) ((wcmatch (vla-get-objectname blk) "*Text") (vla-put-layer blk "Text") ) ) ) ) (if locklst (vlax-for lay layers (if (vl-position (vla-get-name lay) locklst) (vla-put-lock lay :vlax-true) ) ) ) (princ) )
Hope that helps
Henrique
I recommend the Layer Director" lisp by Lee Mac
http://www.lee-mac.com/layerdirector.html
It is georgious.
I recommend the Layer Director" lisp by Lee Mac
http://www.lee-mac.com/layerdirector.html
It is georgious.
Thank you damian!