Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
bdsmls
Posts: 88
Registered: ‎10-17-2008
Message 1 of 3 (317 Views)

LISP to create a two line MLEADER

317 Views, 2 Replies
07-18-2012 08:36 AM

I'm trying to write a lisp routine to create a two line MLEADER but i can only get one line of text. Creating the MLEADER manually from the command line i just have to hit enter after the first line of text to add a second line. How would i do this in a lisp routine?

 

Larry

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 3 (282 Views)

Re: LISP to create a two line MLEADER

07-22-2012 02:42 PM in reply to: bdsmls

Hi, Larry

Try this routine, set your text before:

(defun C:demo(/)
(setq txt "Blah\\PBlah\\PBlah");<-- set mleader text here
(princ "Type any character in the mtext window")
(command "_mleader" "_O" "_C" "_M" "_A" "_Y" "" "_X"  "_L" "_C" pause pause pause)
(setq ee (entget (setq en (entlast))))
(setq ee (subst (cons 304 txt)(assoc 304 ee) ee))
  (entmod ee)
  (entupd en)
  (command "_mleaderedit" "_L" "" "_A" (getpoint ) "")
  (princ)
  )

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Valued Contributor
bdsmls
Posts: 88
Registered: ‎10-17-2008
Message 3 of 3 (266 Views)

Re: LISP to create a two line MLEADER

07-23-2012 04:09 AM in reply to: Hallex

thanks for the response J

i just came up with a solution on friday thats works very nicely

 

(SETQ TELE(STRCAT TPFIX (RTOS TLV 4 2)))

(SETQ BELE(STRCAT BPFIX (RTOS BLV 4 2)))

(SETQ DUCEL(STRCAT TELE (CHR 10) BELE))

(COMMAND "MLEADER" BPT PAUSE DUCEL)

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!