Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with multi-leader lisp

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
codyt8VRMG
518 Views, 6 Replies

Help with multi-leader lisp

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

Labels (4)
6 REPLIES 6
Message 2 of 7
ВeekeeCZ
in reply to: codyt8VRMG

Yes, post the dwg file.

Message 3 of 7
codyt8VRMG
in reply to: ВeekeeCZ

I edited the original post as well.

Thank you

Message 4 of 7
ВeekeeCZ
in reply to: codyt8VRMG

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)
  )

 

Message 5 of 7
codyt8VRMG
in reply to: ВeekeeCZ

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!

Message 6 of 7
ВeekeeCZ
in reply to: codyt8VRMG

It uses your current UNITS setting.

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

Message 7 of 7
codyt8VRMG
in reply to: ВeekeeCZ

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!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report