LISP for Multileader with increment

LISP for Multileader with increment

rcrieza
Explorer Explorer
1,490 Views
4 Replies
Message 1 of 5

LISP for Multileader with increment

rcrieza
Explorer
Explorer

I am trying to insert multileader with 2 to 3 lines of mtext.

The first line is where the increment will happen

Second line: no increment

Third line: no increment

 

What I wanted is when I enable the LISP I can put the mleader anywhere and it automatically increments the number I wanted.

 

Here is a snip so you can see why the are 3 lines in the mleader:

snip1.png

 

0 Likes
Accepted solutions (1)
1,491 Views
4 Replies
Replies (4)
Message 2 of 5

rcrieza
Explorer
Explorer

I already have a lisp file where you can insert just one line of the mleader. But I also need the 2nd and third line for my mleader to be complete. Thanks!

 *lisp file is not mine. just copied it from this community as well

 

0 Likes
Message 3 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try this. It adds no additional chars but paragraph marks

 

(vl-load-com)

(defun c:IncAt ( / 1line 2line 3line startNos p1 p2)
  (if (and
	(setq 1line (getstring T "\n1st line text: " ))
	(setq startNos (getint "\nEnter Start number: "))
	(setq 2line (getstring T "\n2nd line text: " ))
	(setq 3line (getstring T "\n3rd line text: " ))
	)
    (while (and
	     (setq p1 (getpoint "\nPick target point"))
	     (setq p2 (getpoint p1 "\nText Location"))
	     )
      (command "_Mleader" "_non" (trans p1 1 0) "_non" (trans p2 1 0) "")
      (vla-put-textstring (vlax-ename->vla-object (entlast))
	(strcat 1line (itoa startNos) "\\P" 2line (if (= "" 3line) "" (strcat "\\P" 3line))))
      (setq startNos (1+ startNos)))
    )
  (princ)
  ) 

 

0 Likes
Message 4 of 5

rcrieza
Explorer
Explorer

It totally works. Thanks!

0 Likes
Message 5 of 5

m_mobarak2025
Community Visitor
Community Visitor

HOW CAN I START WITH NUMBER NUMBER AND THEN TEXT

 

EXAMPLE:

01/PPAC

NOT 

PPAC/01

0 Likes