TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Oak3s on April 20, 2010, 03:25:11 PM
-
The routine works well. I believe the routine is one originally from CAB's library. I dont have the information to give proper credit.
What we would like to do is pause the leader command so we can see the leader. Currently we see the 'line' the leader will be drawn on but we dont see the leader arrow. Its a little thing but would be cool if it showed up.
The hangup is we need to save the points in order to give the text a point to be based on.
Is there a way to "getpoint" of a pause (verbiage is probably totally wrong)
(setq PT1 (getpoint "\nPick Leader Start Point: "))
(setq PT2 (getpoint PT1 "\nPick Leader Second Point: "))
(if (> (car PT1) (car PT2))
(setq PT3 (polar PT2 0 (* DIMSC -0.125)))
(setq PT3 (polar PT2 0 (* DIMSC 0.125)))
)
(command ".leader" PT1 PT2 PT3 "" "" "None")
(if (> (car PT1) (car PT2))
(setq PT4 (polar PT3 0 (* DIMSC -0.0625)))
(setq PT4 (polar PT3 0 (* DIMSC 0.0625)))
)
-
Maybe something like this:
(setq dimsc (getvar 'dimscale))
(setq pt1 (getpoint "\nPick Leader Start Point: "))
(vl-cmdf ".leader" pt1 pause "" "" "None")
(setq pt2 (getvar 'lastpoint))
(entdel (entlast))
(vl-cmdf ".leader"
pt1
pt2
(if (> (car pt1) (car pt2))
(setq pt3 (polar pt2 0 (* dimsc -0.125)))
(setq pt3 (polar pt2 0 (* dimsc 0.125)))
)
""
""
"None"
)
(if (> (car pt1) (car pt2))
(setq pt4 (polar pt3 0 (* dimsc -0.0625)))
(setq pt4 (polar pt3 0 (* dimsc 0.0625)))
)
**You should look into mleaders and mleader styles.
-
Ah, I was thinking about something similar. Create a leader and then delete it. That solved that. Thanks again. Works very nice.
As for mleaders...great idea and we have had the discussion in the company before. Problem seems to be our detail library is packed with leaders and text...not mleaders. :cry: maybe someday.
Thanks again.
-
... Problem seems to be our detail library is packed with leaders and text...not mleaders. :cry: maybe someday.
Thanks again.
Perhaps this would be of help to clean them up:
http://www.theswamp.org/index.php?topic=30934.msg364891#msg364891
-
Slick Ron. :)
You should store (entlast) before issueing the first leader command with Pause for comparison. That way, if the user doesn't specify a second point, the routine won't continue and erase some other object.
Maybe something like this:
(setq dimsc (getvar 'dimscale))
(setq pt1 (getpoint "\nPick Leader Start Point: "))
(vl-cmdf ".leader" pt1 pause "" "" "None")
(setq pt2 (getvar 'lastpoint))
(entdel (entlast))
(vl-cmdf ".leader"
pt1
pt2
(if (> (car pt1) (car pt2))
(setq pt3 (polar pt2 0 (* dimsc -0.125)))
(setq pt3 (polar pt2 0 (* dimsc 0.125)))
)
""
""
"None"
)
(if (> (car pt1) (car pt2))
(setq pt4 (polar pt3 0 (* dimsc -0.0625)))
(setq pt4 (polar pt3 0 (* dimsc 0.0625)))
)
**You should look into mleaders and mleader styles.
-
How would you go about doing that?
(setq ent1 (entlast))
But I dont know what to do with that. :|
This was an idea i tried...not working.
(setq PT1 (getpoint "\nSpecify first leader point: "))
(princ "\nSpecify next point: ")
(vl-cmdf ".leader" pt1 pause "" "" "None")
(setq pt2 (getvar 'lastpoint))
(if (> pt2 nil)(entdel (entlast))) ;;; I am missing something because this isnt working as I thought
-
Perhaps:
(setq LastEntity (entlast))
(setq dimsc (getvar 'dimscale))
(setq pt1 (getpoint "\nPick Leader Start Point: "))
(vl-cmdf ".leader" pt1 pause "" "" "None")
(setq pt2 (getvar 'lastpoint))
(if (not (equal LastEntity (entlast)))
(progn
(entdel (entlast))
(vl-cmdf ".leader"
pt1
pt2
(if (> (car pt1) (car pt2))
(setq pt3 (polar pt2 0 (* dimsc -0.125)))
(setq pt3 (polar pt2 0 (* dimsc 0.125)))
)
""
""
"None"
)
(if (> (car pt1) (car pt2))
(setq pt4 (polar pt3 0 (* dimsc -0.0625)))
(setq pt4 (polar pt3 0 (* dimsc 0.0625)))
)
)
)
Be sure to use the correct function (equal, eq or =) :-)
-
Precisely what I was getting at. :kewl:
Perhaps:
(setq LastEntity (entlast))
(setq dimsc (getvar 'dimscale))
(setq pt1 (getpoint "\nPick Leader Start Point: "))
(vl-cmdf ".leader" pt1 pause "" "" "None")
(setq pt2 (getvar 'lastpoint))
(if (not (equal LastEntity (entlast)))
(progn
(entdel (entlast))
(vl-cmdf ".leader"
pt1
pt2
(if (> (car pt1) (car pt2))
(setq pt3 (polar pt2 0 (* dimsc -0.125)))
(setq pt3 (polar pt2 0 (* dimsc 0.125)))
)
""
""
"None"
)
(if (> (car pt1) (car pt2))
(setq pt4 (polar pt3 0 (* dimsc -0.0625)))
(setq pt4 (polar pt3 0 (* dimsc 0.0625)))
)
)
)
Be sure to use the correct function (equal, eq or =) :-)
-
Awesome! Thank you both.
-
I still vote for Mleaders :-P
-
Oh yeah, I forgot to mention that I followed the link above and the routine is great. I am going to look more into it when time is available. Thanks for the recommendation. If only mtext wasnt a pain to edit...specifically ENTER/RETURN to close. I read something about 2011 having something new to do with this....hmmmm...
-
I still vote for Mleaders :-P
Ditto :love:
-
Oh yeah, I forgot to mention that I followed the link above and the routine is great. I am going to look more into it when time is available. Thanks for the recommendation. If only mtext wasnt a pain to edit...specifically ENTER/RETURN to close. I read something about 2011 having something new to do with this....hmmmm...
Hit ctrl+enter to exit the edit mtext command.
Also, picking outside the editor window is as good as enter or ctrl+enter and a bit faster to boot.
-
Hit ctrl+enter to exit the edit mtext command.
Also, picking outside the editor window is as good as enter or ctrl+enter and a bit faster to boot.
Didn't know that! Thanks Alan :-)
-
You're welcome.
More mtext tips:
http://www.theswamp.org/index.php?topic=28950.0
-
Hit ctrl+enter to exit the edit mtext command.
Also, picking outside the editor window is as good as enter or ctrl+enter and a bit faster to boot.
Didn't know that! Thanks Alan :-)
Boo clicking OK
-
I still vote for Mleaders :-P
He's dealing with a mentality that won't allow multiple layout tabs in one of their offices because a couple of the drafters (the "CAD Manager" being (the main) one of them) can't remember to look to see if there are other tabs when they plot and don't notice that they are missing sheets before a) giving drawings to the engineer or b) sending jobs out.
-
:lol: To true...
-
I don't miss that. Not for a second.
Back on to the side discussion though, I decided to go with mtext and mleaders in this office and am generally happy with the decision although I run into a few quirks at times that bug a bit. The one negative that I have with MTEXT though, especially on single line text, is the ability to edit the text in the properties bar.
-
I don't miss that. Not for a second.
Back on to the side discussion though, I decided to go with mtext and mleaders in this office and am generally happy with the decision although I run into a few quirks at times that bug a bit. The one negative that I have with MTEXT though, especially on single line text, is the ability to edit the text in the properties bar.
I've never understood why they made that available (or really just made it unavailable). You can access all the formatting codes.