TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MSTG007 on June 16, 2022, 05:45:38 PM
-
I am trying to find a method to where I can select Mtext or MLeader and explode it, then with the new single lined texts; apply a new command which would move the text to layer 0.
I know this a basic to make bold, but I am trying to figure how to tie everything together using the following:
(defun C:test (/ ss)
(setq ss (ssget "x"))
(initcommandversion 2)
(command "explode" "p" "")
(command "change" ss "" "p" "la" "0" "")
(princ))
How would I go about doing that?
-
(defun C:test (/ ss)
(setvar "qaflags" 1)
(setq ss (ssget ))
(command "explode" ss "")
(command "change" "p" "" "p" "la" "0" "")
(setvar "qaflags" 0)
(princ))
-
;;;option 1
(defun c:test (/ ss)
(setq ss (ssget "x"))
(initcommandversion 2)
(command "explode" "p" "")
(setq ss (ssget "P"));_add this line
(command "change" ss "" "p" "la" "0" "")
(princ)
)
;;;option 2
(defun c:test (/ ss)
(setq ss (ssget "x"))
(initcommandversion 2)
(command "explode" "p" "")
(setq ss (ssget "x"));_add this line
(command "change" ss "" "p" "la" "0" "")
(princ)
)
-
I don't think "P" works since everything "exploded" items are considered new and not previous.
Visual lisp way creates a copy of ent and explodes it into sub entity's. The foreach will allow you to step thought each sub entity.
Autolisp way sets a "save point" with lastent and then explodes selected entity's. With all new entity's created are behind lastent in the dxf file. the while loop for en will add these to a selection set you define.
(while en
;add all new entity's created by explosion back into selection set. )
)
-
Hello mhupp
with all respect,
the new selection set with "p" works after the explode,
(command "explode" "p" "")
(setq ss (ssget "p"))
I constantly use this method.
Try, do a test.
-
Yes I your right I looked over my code and was doing several other operations after explode that would negate the Previous selection to only select a few items of the original explode.
or I was stepping though a selection set doing the explode one by one and then grouping them back up again.
apologizes