I just started to learn lisp and mostly am copy-pasting and checking one by one. I do not have a programing background or anything like that so please help me to understand.
Last time I make something I need. It was successfully I finished.
Please tell me if there is any mistake or your suggestion
And if you can put your way for the same task that may be I can understand very well on new things
(while
(progn
(setq entldr nil enttxt nil)
(if
(setq sel(LM:ssget "\nSelect Text & leader: "
(list "_:L"
(list
'(000 . "TEXT,MTEXT,LEADER")
(if (= 1 (getvar 'cvport))
(cons 410 (getvar 'ctab))
'(410 . "Model")
)
)
)
)
)
(progn
(cond
( (< 2 (sslength sel))
(princ "\nThe selection have more than 2 object")
)
( (= 1 (sslength sel))
(progn
(cond
( (not (wcmatch(cdr (assoc 0(entget(ssname sel 0))))"TEXT,MTEXT"))
(princ "\nThe selection don't have text")
)
( (not (wcmatch(cdr (assoc 0(entget(ssname sel 0))))"LEADER"))
(princ "\nThe selection don't have leader")
))
)
)
( (= 2 (sslength sel))
(progn
(repeat (setq i (sslength sel))
(or (not (entget (setq ent (ssname sel (setq i (1- i))))))
(if
(not (wcmatch(cdr (assoc 0(entget ent)))"TEXT,MTEXT"))
(setq entldr ent)
(setq enttxt ent)))
)
(cond
( (= entldr nil)
(princ "\nThe selection have multiple text")
)
( (= enttxt nil)
(princ "\nThe selection have multiple leader")
)
)
)
)
)
)
)
)
)