Mleader to Block

Mleader to Block

bit_Cad2018
Advocate Advocate
676 Views
1 Reply
Message 1 of 2

Mleader to Block

bit_Cad2018
Advocate
Advocate

Hi Users,

                 I have lots of Mleder CS Number wise I am trying to make a block CS Number wise If you have any suggestion please tell me 

 

Please see attached DWG file for your reference

0 Likes
Accepted solutions (1)
677 Views
1 Reply
Reply (1)
Message 2 of 2

kajanthangavel
Advocate
Advocate
Accepted solution

Hi, Something for you.

 

Working Sample

Screencast2.gif

 

 

Code Here..

Try with 'MTB'

(vl-load-com)
(defun c:mtb (/ hnd urpt str msp msp)
(defun rh:d2r (d) (* pi (/ d 180.0)))
    (if (setq ss (ssget ":L" '((0 . "MULTILEADER"))))
        (progn
            (repeat (setq i (sslength ss))
                (setq hnd (ssname ss (setq i (1- i)))
					  str (vlax-get-property (vlax-ename->vla-object hnd) 'TextString)
					  msp (cdr (assoc 110 (entget hnd)))
					  mep (cdr (assoc 10 (entget hnd)))
                )
				
				(vla-getboundingbox (vlax-ename->vla-object hnd) 'mn 'mx)
                (setq urpt (vlax-safearray->list mx))
				(command "_.rotate" ss "" msp "_reference" mep msp (polar msp (rh:d2r 180) 1000))
				
				(if (not (tblsearch "BLOCK" (substr str 29 6)))
					(progn
						(command "_.-block" (substr str 29 6) urpt ss "" )
						(command "_.-insert" (substr str 29 6) urpt "" "" ""))
				
					(prompt "This Nme of Multileader already done")
				)
			)
		)
	)
(princ)
)

 

I tired with finding Multileader Base point..

I hope, It is Help to you.

 

Lips file here

 

0 Likes