Jump to content
pmcwilliams

Leader/text to multileader

Recommended Posts

pmcwilliams

I'm looking for a way to convert leader and text that is separate into a multileader where the text is attached to the leader. We just updated to new standards using the multileader and all the old stuff is not attached.

 

I'm using AutoCad 2009.

 

Thanks in advance.

Share this post


Link to post
Share on other sites
NBC

Be aware when using that routine that the exact positioning of the Multi-Leader Text that replaces the QLeader Text may not be at the same point.

Share this post


Link to post
Share on other sites
pmcwilliams
Be aware when using that routine that the exact positioning of the Multi-Leader Text that replaces the QLeader Text may not be at the same point.

 

Thanks for your concern but the text is actually attaching right where I need it to. (Or should I say where the company wants it to)

 

I'm not sure I like where the text attaches (In the middle of the note) because to me it goes against all drafting practices that I was taught years ago.

Share this post


Link to post
Share on other sites
Bigbongo

Hi I am using 2012 and after selecting the leader + text is asking for location and then again for text.

Share this post


Link to post
Share on other sites
Organic
Hi I am using 2012 and after selecting the leader + text is asking for location and then again for text.

 

It works.

 

I wouldn't say its that accurate with regards to the justification as above though.

Share this post


Link to post
Share on other sites
Bigbongo

Hi "super member", can you be a little more explicit? Justification is not important now, however put together leader + text will be very useful to update old dwg. I am missing something??? I am selecting the old leader with no place for text, just the arrow and the text is a multitext entity. Please let me know TX

 

Newbie member!!!

Share this post


Link to post
Share on other sites
cooldude

Hello all, this lisp works great but i would like to know if someone can do a slight modification. The reason i am using this lisp is because i have many drawings where the leaders have been exploded. So i would like to replace the text and exploded leaders with multileaders. I wont the new multileader to be in the same place as the old one so what i would like to do is pick the leaders to delete but not actually delete them until i can pick the points to where they are for the new leader. This way i don't lose the existing position of the existing leaders. I hope this make sense. Can anyone help me with this. The lisp is below.

 

(defun c:am (/ newleader pt1 pt2 ss txt x w rjp-getbbwdth)

(vl-load-com)

(defun rjp-getbbwdth (obj / out ll ur)

(vla-getboundingbox obj 'll 'ur)

(setq out (mapcar 'vlax-safearray->list (list ll ur)))

(distance (car out) (list (caadr out) (cadar out)))

)

(if (setq ss (ssget '((0 . "*TEXT"))))

(progn (setq txt (apply

'strcat

(mapcar

'cdr

(vl-sort

(mapcar '(lambda (x)

(cons (vlax-get x 'insertionpoint)

(strcat (vlax-get x 'textstring) " ")

)

)

(setq

ss (mapcar

'vlax-ename->vla-object

(vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))

)

)

)

(function (lambda (y1 y2) (

)

)

)

)

w (car (vl-sort (mapcar 'rjp-getbbwdth ss) '>))

txt (apply 'strcat

(mapcar 'chr (reverse (cdr (reverse (vl-string->list txt)))))

)

)

(mapcar 'vla-delete ss)

)

)

(if (and (setq pt1 (getpoint "\nSpecify leader arrowhead location: "))

(setq pt2 (getpoint pt1 "\nSpecify landing location: "))

)

(progn (command "._MLEADER" pt1 pt2 "")

(setq newleader (vlax-ename->vla-object (entlast)))

(vla-put-textstring newleader txt)

(vla-put-textwidth newleader w)

)

)

(princ)

)

Share this post


Link to post
Share on other sites
SLW210

Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE]

Your Code Here[/NOPARSE]

=

Your Code Here

Share this post


Link to post
Share on other sites
cooldude

My apologies. i did not know that.

(defun c:am (/ newleader pt1 pt2 ss txt x w rjp-getbbwdth)
(vl-load-com)
(defun rjp-getbbwdth (obj / out ll ur)
(vla-getboundingbox obj 'll 'ur)
(setq out (mapcar 'vlax-safearray->list (list ll ur)))
(distance (car out) (list (caadr out) (cadar out)))
)
(if (setq ss (ssget '((0 . "*TEXT"))))
(progn (setq txt (apply
'strcat
(mapcar
'cdr
(vl-sort
(mapcar '(lambda (x)
(cons (vlax-get x 'insertionpoint)
(strcat (vlax-get x 'textstring) " ")
)
)
(setq
ss	(mapcar
'vlax-ename->vla-object
(vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
)
)
)
(function (lambda (y1 y2) (< (cadr (car y2)) (cadr (car y1))))
)
)
)
)
w (car (vl-sort (mapcar 'rjp-getbbwdth ss) '>))
txt (apply 'strcat
(mapcar 'chr (reverse (cdr (reverse (vl-string->list txt)))))
)
)
(mapcar 'vla-delete ss)
)
)
(if (and (setq pt1 (getpoint "\nSpecify leader arrowhead location: "))
(setq pt2 (getpoint pt1 "\nSpecify landing location: "))
)
(progn (command "._MLEADER" pt1 pt2 "")
(setq newleader (vlax-ename->vla-object (entlast)))
(vla-put-textstring newleader txt)
(vla-put-textwidth newleader w)
)
)
(princ)
)

Share this post


Link to post
Share on other sites
cooldude
(defun c:am (/ newleader pt1 pt2 ss txt x w rjp-getbbwdth)
(vl-load-com)
(defun rjp-getbbwdth (obj / out ll ur)
(vla-getboundingbox obj 'll 'ur)
(setq out (mapcar 'vlax-safearray->list (list ll ur)))
(distance (car out) (list (caadr out) (cadar out)))
)
(if (setq ss (ssget '((0 . "*TEXT"))))
(progn (setq txt (apply
'strcat
(mapcar
'cdr
(vl-sort
(mapcar '(lambda (x)
(cons (vlax-get x 'insertionpoint)
(strcat (vlax-get x 'textstring) " ")
)
)
(setq
ss	(mapcar
'vlax-ename->vla-object
(vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
)
)
)
(function (lambda (y1 y2) (< (cadr (car y2)) (cadr (car y1))))
)
)
)
)
w (car (vl-sort (mapcar 'rjp-getbbwdth ss) '>))
txt (apply 'strcat
(mapcar 'chr (reverse (cdr (reverse (vl-string->list txt)))))
)
)
(mapcar 'vla-delete ss)
)
)
(if (and (setq pt1 (getpoint "\nSpecify leader arrowhead location: "))
(setq pt2 (getpoint pt1 "\nSpecify landing location: "))
)
(progn (command "._MLEADER" pt1 pt2 "")
(setq newleader (vlax-ename->vla-object (entlast)))
(vla-put-textstring newleader txt)
(vla-put-textwidth newleader w)
)
)
(princ)
)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×