Author Topic: Rebuild 3 Piece Exploded Leader?  (Read 2309 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Rebuild 3 Piece Exploded Leader?
« on: June 19, 2015, 09:06:15 AM »
I am noticing a lot of details that have leaders exploded to them. The Arrow is a solid, then with the line and leadin line. Is there a routine that could rebuild or make it back to a mleader or something easily?
Civil3D 2020

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Rebuild 3 Piece Exploded Leader?
« Reply #1 on: June 19, 2015, 09:39:44 AM »
You too? We have the same problem. If that has happened, you may even find discrepancies in the arrow head size and possibly other inconsistencies.

I've been recreating the leaders manually.
CAD Tech

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Rebuild 3 Piece Exploded Leader?
« Reply #2 on: June 19, 2015, 09:42:21 AM »
i will say this, I have seen lisp routines that can take a leader (that is not exploded) and then convert it to the default mleader style. That works pretty good. But hey, nothing wrong with asking...
Civil3D 2020

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Rebuild 3 Piece Exploded Leader?
« Reply #3 on: June 19, 2015, 09:45:35 AM »
That is not hard to do and could be utilized if you find a way to rebuild them from what you have.
CAD Tech

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Rebuild 3 Piece Exploded Leader?
« Reply #4 on: June 19, 2015, 09:49:33 AM »
That was kinda of the thought I had.... But could you imagine cleaning up details on the fly if this could work? Heck it would be awesome if you could do several at once. Go into the detail source dwg, select all the broken exploded texts and broke leaders and then magically convert them back to a mleader?  :-D
Civil3D 2020

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Rebuild 3 Piece Exploded Leader?
« Reply #5 on: June 19, 2015, 09:54:13 AM »
The cool routine would be to somehow have the program find the fool that exploded all the leaders and unleash a horde of angry wasps on them.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Rebuild 3 Piece Exploded Leader?
« Reply #6 on: June 19, 2015, 10:47:58 AM »
Do you have an example drawing? Does not seem like it would be too hard to accomplish.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Rebuild 3 Piece Exploded Leader?
« Reply #7 on: June 19, 2015, 11:45:31 AM »
Ron, I have sent you an email with some details in it.
Civil3D 2020

Bethrine

  • Guest
Re: Rebuild 3 Piece Exploded Leader?
« Reply #8 on: June 19, 2015, 11:09:52 PM »
Those pesky things slowed me down about every other drawing. My condolences. I ended up putting them on their own layer then basically pasting mleaders over them. Then I deleted from the isolated layer.

I kept wishing the "find and replace" for text would work. Hope you guys solve this. ☺

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Rebuild 3 Piece Exploded Leader?
« Reply #9 on: June 22, 2015, 10:16:08 AM »
I don't think there's a 'magic bullet' for the detail you sent. HERE's something I wrote a while back that could help speed up the process a bit.


You could also try this quickly written code to speed up the process:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ _dxf lp lp2 lpe ml ss txt x)
  2.   (defun _dxf (code ename)
  3.     (if ename
  4.       (cdr (assoc code (entget ename)))
  5.     )
  6.   )
  7.   ;; Single pick cleanup
  8.   ;; Requires all of the following items          -->
  9.   (cond ((null (and (setq ss (ssget ":L" (list '(0 . "text,line,solid"))))
  10.                     (setq ss (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
  11.                )
  12.          )
  13.          (print "Bye...")
  14.         )
  15.         ((not (setq
  16.                 lp (_dxf 12 (setq lpe (car (vl-remove-if-not '(lambda (x) (= "SOLID" (_dxf 0 x))) ss))))
  17.               )
  18.          )
  19.          (print "Leader point not found...")
  20.         )
  21.         ((not (setq lp2
  22.                      (car (vl-sort (apply 'append
  23.                                           (mapcar '(lambda (x) (list (_dxf 10 x) (_dxf 11 x)))
  24.                                                   (vl-remove-if-not '(lambda (x) (= "LINE" (_dxf 0 x))) ss)
  25.                                           )
  26.                                    )
  27.                                    '(lambda (a b) (> (distance a lp) (distance b lp)))
  28.                           )
  29.                      )
  30.               )
  31.          )
  32.          (print "Lines not selected...")
  33.         )
  34.         ((not (setq txt (vl-sort (vl-remove-if-not '(lambda (x) (= "TEXT" (_dxf 0 x))) ss)
  35.                                  '(lambda (a b) (> (cadr (_dxf 10 a)) (cadr (_dxf 10 b))))
  36.                         )
  37.               )
  38.          )
  39.          (print "Text not selected...")
  40.         )
  41.         (t
  42.          (command "._mleader" lp lp2 "")
  43.          (setq ml (vlax-ename->vla-object (entlast)))
  44.          (vla-put-textstring
  45.            ml
  46.            (vl-string-right-trim
  47.              "\\P"
  48.              (apply 'strcat (mapcar '(lambda (x) (strcat (_dxf 1 x) "\\P")) txt))
  49.            )
  50.          )
  51.          (vla-put-layer ml (_dxf 8 (car txt)))
  52.          ;; Suggest using an mleader style rather than these hardcoded values below :)
  53.          ;; may Sh!+ the bed depending on the CMLEADERSTYLE
  54.          (vla-put-textstylename ml (_dxf 7 (car txt)))
  55.          (vla-put-textheight ml (_dxf 40 (car txt)))
  56.          (vla-put-arrowheadsize ml (distance lp (_dxf 10 lpe)))
  57.          (mapcar 'entdel ss)
  58.         )
  59.   )
  60.   (princ)
  61. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Rebuild 3 Piece Exploded Leader?
« Reply #10 on: June 22, 2015, 10:47:44 AM »
That is some pretty wild stuff. Crazy how you had that laying around. lol. Everything is pretty much as needed minus the select everything and it does it. But like you said most of the work is done. Could there be a way if there is a qleader that it could use that as well? or in the routine it could accept it and explode it then convert it over? Again SWEET!
Civil3D 2020

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Rebuild 3 Piece Exploded Leader?
« Reply #11 on: June 22, 2015, 11:16:31 AM »
I believe the code referenced HERE accounts for associated leaders. IMO it would be very easy to just explode the items you want to clean up before you run the code.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Rebuild 3 Piece Exploded Leader?
« Reply #12 on: June 22, 2015, 11:25:15 AM »
hehehe.... that is what I was thinking. placing it in a macro to do my exploding and then run the code:) Still very sweet code!
Civil3D 2020

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Rebuild 3 Piece Exploded Leader?
« Reply #13 on: June 22, 2015, 11:37:45 AM »
Glad you can make use of it :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC