Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Help with multi-leader lisp

codyt8VRMG
Participant

Help with multi-leader lisp

codyt8VRMG
Participant
Participant

I  have no programming experience so I am hoping someone can help me make a lisp file.

I need it too pull out 3 points of data from the block and place them in a multi-leader.

I have included images of what I would like it to look like, the data I need include and the block construction.

If needed I can upload an autocad file.

If it is important I am using autocad 2023

0 Likes
Reply
Accepted solutions (1)
693 Views
6 Replies
Replies (6)

ВeekeeCZ
Consultant
Consultant

Yes, post the dwg file.

0 Likes

codyt8VRMG
Participant
Participant

I edited the original post as well.

Thank you

0 Likes

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try this. I needed to restrict a leader's points to 2. Or it could be 3 if you like, but it needs to be a fixed value.

 

(defun c:StairCallout ( / s m b d f r w)
  
  (if (and (setq s (car (entsel "\nSelect a block: ")))
	   (setq m (getstring "\nRise: "))
	   (setq b (tblobjname "block" (cdr (assoc 2 (entget s)))))
	   (progn
	     (while (setq b (entnext b))
	       (and (setq f (entget b))
		    (= "ATTDEF" (cdr (assoc 0 f)))
		    (= "STAIR_DESCRIPTION" (cdr (assoc 2 f)))
		    (setq d (cdr (assoc 1 f)))))
	     d)
	   (setq r (getpropertyvalue s "AcDbDynBlockPropertyRUN"))
	   (setq w (getpropertyvalue s "AcDbDynBlockPropertyWIDTH"))
	   )
    (command "_.mleader" pause pause "_E" (strcat d "\\P" (rtos r) " X " m "\\P" (rtos w) "W")))
  (princ)
  )

 

0 Likes

codyt8VRMG
Participant
Participant

This is amazing thank you!

If possible is it possible to convert the width to a fraction?

If not I can still work with this and appreciate the help!

0 Likes

ВeekeeCZ
Consultant
Consultant

It uses your current UNITS setting.

But we can override it by (rtos w 5). according to THIS 

0 Likes

codyt8VRMG
Participant
Participant

It is a bit of an awkward set up because we need decimal units for other more accurate parts.

This however worked perfectly for these notes!

Thank you so much!

0 Likes