TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jmaeding on November 20, 2018, 06:07:54 PM

Title: Replacement for lost DIM LEA command 2015- had
Post by: jmaeding on November 20, 2018, 06:07:54 PM
I got a request for this so try this. Command is DIMLEA.
Anyone watching might also harvest its functions for entmaking of solid, lines, and mtext.
Title: Re: Replacement for lost DIM LEA command 2015- had
Post by: cmwade77 on November 21, 2018, 11:44:40 AM
A viable alternative to this approach is to use the mLeader command and then explode it after its creation and text entry.

Something like this should do the trick:
Code: [Select]
(defun c:DimLea (/ Pt1 Pt2)
    (command "._mleader" "_O" "_A" "_Y" "0" "_X" (SETQ Pt1 (getpoint "\nSpecify leader arrowhead location:")) (setq Pt2 (getpoint Pt1 "\nSpecify landing location:")) (getpoint Pt2 "\nSpecify landing length:") (getstring T "\nEnter dimension text:"))
    (command "._explode" (entlast) "")
    (princ)
)

You could and should add a lot more error handling, but this gives a quick proof of concept on this. For us, we have found we like mleaders much better, but this accomplishes your goal.
Title: Re: Replacement for lost DIM LEA command 2015- had
Post by: jmaeding on November 21, 2018, 12:32:01 PM
I thought about such an approach, for qleader command also.
You have to be really careful about adding "explode" (entlast) to functions though.
It the user does something that causes nothing to be drawn, some other entity gets exploded.
Also, you need to account for leaders with more than 1 segment. You can do a loop for that.
Mleaders are indeed nice, just a lot harder to manipulate after drawn, than the old qleader results.
I must say though, that at a minimum the exploded dims from DIM LEA would drive me nuts.
That arrowhead not staying in line with the leader when modified is more than my brain could handle.
We absolutely do not allow exploded leaders at my place.