I just intend to move what is in layer 0 and Defpoints (layers that always exist in the tables where I work) to a new layer called "00".
to do this i intend to use an .lsp file
I don't want to have the layers selected as I already know the names. even if the program repeats itself 2 times, I don't care.
to create and make the new layer "00" active, I have found that it is sufficient to do the following command:
(defun C:PFB (/)
(command "_-layer" "_n" "00" "_c" "252" "00" "_s" "00" "")
)
ps. i'm using a non-English version, that's why there are "_" before each command
Solved! Go to Solution.
Solved by Moshe-A. Go to Solution.
@f_rivaXGG6C hi,
check this
enjoy
moshe
(defun c:chglay (/ ss)
(if (setq ss (ssget "_X" '((8 . "0,defpoints"))))
(progn
(command "._layer" "_Make" "00" "_Color" 252 "00" "")
(command "._chprop" "_si" ss "_Layer" "00" "")
); progn
); if
(princ "\nDone.")
(princ)
)
can I ask you what exactly you wrote?
tried it and it works fine, but i also need to import this command within another one
thank you very much
with comments for you 😀
(defun c:chglay (/ ss)
(if (setq ss (ssget "_X" '((8 . "0,defpoints")))) ; select all objects on layer 0 + defpoints
(progn
(command "._layer" "_Make" "00" "_Color" 252 "00" "") ; create layer
(command "._chprop" "_si" ss "_Layer" "00" "") ; change layer
); progn
); if
(princ "\nDone.")
(princ)
)
Thank mate, I got some problem that I can't change layers inside blocks. Is there any solution? Sorry my English not very well
Please, open new thread attach sample dwg contain your block, explain what do you want to change?
Moshe
Can't find what you're looking for? Ask the community or share your knowledge.