TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: kruuger on September 30, 2013, 03:32:20 AM
-
hello,
can we add or remove additional leader from mleader with lisp?
i know that we can right click on object and then add/remove but it is time consuming.
thanks
kruuger
-
hello,
can we add or remove additional leader from mleader with lisp?
i know that we can right click on object and then add/remove but it is time consuming.
Hi kruuger
You can adds a new leader line to Mleader:
used this code:
(defun jk:ACX_AddMLeaderPointEx
(en pt
/ d vo pts
) )
)
)
)
)
)
)
)
)
(vla-AddLeaderLineEx vo
Pts
)
)
)
)
regards
kojacek
-
great thanks :)
when we add new leader text change location - see picture.
now i got something to play. i will try to fix this.
kruuger
-
(defun c:ADDL (/ ob)
(if (setq ob (entsel "\nPlease select MULTILEADER: "))
(if (= (cdr (assoc 0 (entget (car ob)))) "MULTILEADER")
(progn
(command "._mleaderedit" (car ob) pause)
)
(princ "\n** Object selected was not a multileader. ** ")
)
(princ "\n** Nothing selected ** ")
)
(princ)
)
(defun c:REML (/ ob)
(if (setq ob (entsel "\nPlease select MULTILEADER: "))
(if (= (cdr (assoc 0 (entget (car ob)))) "MULTILEADER")
(progn
(command "._mleaderedit" (car ob) "_remove" pause)
)
(princ "\n** Object selected was not a multileader. ** ")
)
(princ "\n** Nothing selected ** ")
)
(princ)
)
k.
-
^^
Very sweet. Thanks!
-
You could also combine the two routines into one like so :).
(defun c:arml (/ ob)
(or *mleaderoptionglobal* (setq *mleaderoptionglobal* "Add"))
(initget 0 "Add Remove")
(setq *mleaderoptionglobal*
(cond ((getkword (strcat "\n[Add/Remove] <" *mleaderoptionglobal* ">: ")))
(*mleaderoptionglobal*)
)
)
(if (setq ob (car (entsel "\nPlease select MULTILEADER: ")))
(if (= (cdr (assoc 0 (entget ob))) "MULTILEADER")
(if (= *mleaderoptionglobal* "Add")
(command "._mleaderedit" ob pause)
(command "._mleaderedit" ob "_remove" pause)
)
(princ "\n** Object selected was not a multileader. ** ")
)
(princ "\n** Nothing selected ** ")
)
(princ)
)
-
You could also combine the two routines into one like so :) .
(defun c:arml (/ ob)
(or *mleaderoptionglobal* (setq *mleaderoptionglobal* "Add"))
(initget 0 "Add Remove")
(setq *mleaderoptionglobal*
(cond ((getkword (strcat "\n[Add/Remove] <" *mleaderoptionglobal* ">: ")))
(*mleaderoptionglobal*)
)
)
(if (setq ob (car (entsel "\nPlease select MULTILEADER: ")))
(if (= (cdr (assoc 0 (entget ob))) "MULTILEADER")
(if (= *mleaderoptionglobal* "Add")
(command "._mleaderedit" ob pause)
(command "._mleaderedit" ob "_remove" pause)
)
(princ "\n** Object selected was not a multileader. ** ")
)
(princ "\n** Nothing selected ** ")
)
(princ)
)
i was thinking about this. nice one ronjonp :)
kruuger
-
;D