Jump to content

Leader/text to multileader


pmcwilliams

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 years later...
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 5 years later...

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)

)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...