Removing Space from start of Multileader text

Removing Space from start of Multileader text

tcoley95E9Z
Enthusiast Enthusiast
431 Views
3 Replies
Message 1 of 4

Removing Space from start of Multileader text

tcoley95E9Z
Enthusiast
Enthusiast

I am getting pretty fed up with this, a common project I find myself doing is updating old projects for my company. Everything is smooth sailing until all the leaders and text. We used to notate "New" or "Ex." equipment but now we just list the equipment without "New" or "Ex." in front. Because we have just so many leaders with instances of New or Ex, it is out of the question to do anything but a find replace command. The worst part is I can only replace these instances with a space, Resulting in the diagram below.

 

I would truly appreciate it if someone could help me with a command to simply remove the space in front of these leaders after selecting a handful of leaders. Thanks!

 

Example of how my leaders turn out:

 

         

         /  -------   Example.

      /

    /

 

0 Likes
432 Views
3 Replies
Replies (3)
Message 2 of 4

ronjonp
Mentor
Mentor

@tcoley95E9Z Perhaps:

(defun c:foo (/ o s)
  (if (setq s (ssget ":L" '((0 . "MULTILEADER"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (setq o (vlax-ename->vla-object e))
      (vla-put-textstring o (vl-string-left-trim " " (vla-get-textstring o)))
    )
  )
  (princ)
)
0 Likes
Message 3 of 4

calderg1000
Mentor
Mentor

Regards @tcoley95E9Z 

Try this code...

;;;___
(defun c:dtx (/ sm j txv tx)
  (if (setq sm (ssget "_:L" '((0 . "MULTILEADER"))))
    (repeat (setq j (sslength sm))
      (setq txv (vlax-ename->vla-object (ssname sm (setq j (1- j))))
            tx  (substr (vlax-get-property txv 'Textstring) 2)
      )
      (vlax-put-property txv 'textstring tx)
    )
  )
  (princ)
)

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

@tcoley95E9Z wrote:

... without "New" or "Ex." in front. .... I can only replace these instances with a space, .... 


That is not true for me -- I can get the result you want directly without any custom code.

 

In FIND's "Find what:" slot, put in "New "  or "Ex. " including the space(s) there, and put nothing at all in the "Replace with:" slot.  The result does not have a leading space.

Kent Cooper, AIA
0 Likes