Create Mleader with more than one row.

Create Mleader with more than one row.

Anonymous
Not applicable
575 Views
4 Replies
Message 1 of 5

Create Mleader with more than one row.

Anonymous
Not applicable
Good morning, I have a LISP that identifies the area of ​​an existing polygon and places it with a code in a Leader. My question is if I can do the same but with Mleader instead of Leader. The code and area need to be displayed in two rows (this is the part I can't get done). Thanks for your help.

 

(defun C:ETA ()
(SETQ ETQ (GETSTRING "PREFIJO: "))
(SETQ N (GETINT "VALOR INICIAL: "))	
	(WHILE
		(setq punto (getpoint "\nPunto interno:"))	
		(command "_bpoly" punto "")
		(command "_AREA" "_e" "_last")
		(command "_REDRAWALL")
		(setq pt1 (getpoint punto "\nDesigna posición del texto: "))
		(setq a4 (strcat "Ar=" (rtos (getvar "AREA") 2 2) " m2"))
		(setq a5 (strcat ETQ (ITOA N)))
		(command "_LEADER" punto pt1 "" a5 a4 "")
		(SETQ N (+ N 1))
	)
)

 

 

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

devitg
Advisor
Advisor

@Anonymous , as I  guess the 2 row will be a5 and a4 

Test it 

 

 

(DEFUN C:ETA  (/
A4
A5
A5/4
ETQ
N
POLY
PT1
PUNTO
               )
  (SETQ ETQ (GETSTRING "PREFIJO: "))
  (SETQ N (GETINT "VALOR INICIAL: "))

  (WHILE
    (SETQ PUNTO (GETPOINT "\nPunto interno:"))
     ;;(COMMAND "_bpoly" PUNTO "");; not needed
       
     (COMMAND "_AREA" "_o" "L")

     (COMMAND "_REDRAWALL")
     (SETQ PT1 (GETPOINT PUNTO "\nDesigna posición del texto: "))
     (SETQ A4 (STRCAT "Ar=" (RTOS (GETVAR "AREA") 2 2) " m2"))
     (SETQ A5 (STRCAT ETQ (ITOA N)))
     (SETQ A5/4 (STRCAT A5 "\\P" A4))
     (COMMAND "_LEADER" PUNTO PT1 "" A5/4 "")
     (SETQ N (+ N 1))
     )
  )

 

 

 

Message 3 of 5

devitg
Advisor
Advisor

@Anonymous , find attached lisp and dwg 

Message 4 of 5

pbejse
Mentor
Mentor
Accepted solution

@Anonymous wrote:

My question is if I can do the same but with Mleader instead of Leader. The code and area need to be displayed in two rows



This?

(command "_mleader" punto pt1 (strcat a4 "\\P" a5))

 

Message 5 of 5

Anonymous
Not applicable

Thank you very much to both. for taking into account my query and the speed of the response. Really helped me a lot. The definitive solution is in the last post.

Muchas gracias ambos.

0 Likes