Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody,
I'm using this lisp file from all-in-one-layer. I've changed this a little bit and it works well. But it doesn't works perfect.
This is my lisp;
(vl-load-com) (defun c:DTG (/ 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 '(("DIMENSIONS" 1) ("Leader" 2) ("Text" 2) ("GUIDELINE" 6))) (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 "DIMENSIONS") ) ((wcmatch (vla-get-objectname blk) "*Leader") (vla-put-layer blk "TEXT") ) ((wcmatch (vla-get-objectname blk) "*Text") (vla-put-layer blk "TEXT") ) ((wcmatch (vla-get-objectname blk) "*Xline") (vla-put-layer blk "GUIDELINE") ) ) ) ) (if locklst (vlax-for lay layers (if (vl-position (vla-get-name lay) locklst) (vla-put-lock lay :vlax-true) ) ) ) (COMMAND "-LAYER" "PLOT" "N" "GUIDELINE" "") (princ) )
The differnce between the original and my lisp file, my lisp does create a new (no plot) layer and also it puts the leaders into the layer text.
After using it, every dimension/ leader/ text objects and guidelines became the right layer. But not every dimension/ leader/ text objects and guidelines do have the right color.
This because the object properties are changed into another color instead of color bylayer.
What do I have to change or add to make it works well?
Thanks
Solved! Go to Solution.