Hi friends,
any possibilities for only dimension text above selected lines as shown in figure. please have a look.
Thanking you,
Best regards.
|
Hi friends,
any possibilities for only dimension text above selected lines as shown in figure. please have a look.
Thanking you,
Best regards.
Hi friend,
thank you for response.i dont have to move UCS and some difficulties found while using this command. every time asking origin for each line dimension. i want like 0'-0" instead of 0". lisp routine should be run by following procedure:
1) select the lines
2)Pick origin
3) and develop the dimensions as shown in sample drawing.
Thanks.
Last edited by Structo; 2016-11-23 at 05:05 PM.
friend,
Thank you for response. i look forward for your code.
Thank you.
Ok, I had some time to play around with this, I think this will do what you want.
I have made some assumptions, like you will have the dimension style set up and current that you want, which will show the dimensions the way you want, not suppressing leading and trailing zeros etc.
You can change the command "foo" to whatever you want, that will be what you type on the command line.
I have added ";; comments" along side the code to help walk you through what I came up with (I am not a LISP expert, this a basic routine with flaws and all, that experienced coders may laugh at.. he he)
But it does work.
Code:(defun c:foo (/ osm lin pt1 la lr1) ;; defines function "foo" (command) you can change to whatever you'd like, and (/ list of local variables) (setq osm (getvar "osmode")) ;; records your current running osnaps and sets it equal to "osm" (setvar "osmode" 1) ;; sets osnaps to endpoint (setvar "ucsicon" 3) ;; sets your ucsicon to "on" and at origin (setq lin (ssget)) ;; sets "lin" equal to what you select (you select all the lines you want dimensioned) (setq pt1 (getpoint "\nPick UCS Origin ")) ;; sets "pt1" to endpont you pick for origin 0'-0" (command "ucs" pt1 "") ;; puts ucs on that point (setq la (getvar "clayer")) ;; records your current layer and sets it equal to "la" (setq lr1 (tblsearch "layer" "Dim")) ;; searches for the layer named "Dim" and sets it equal to "lr1" (if (= lr1 nil) ;; if "lr1" not found (doesn't exist) it moves to the following function, if found, skips following function (command "-layer" "make" "Dim" "color" "6" "" "")) ;;makes the layer "Dim" because it wasn't found (command "-layer" "t" "Dim" "s" "Dim" "") ;; thaws and sets "Dim" layer current (command "_qdim" lin "" "ordinate" pause "") ;; runs the quick-dim command, ordinate dimensions, on the lines and origin you selected, (you need to place the dims) (command "ucs" "p") ;; sets the ucs back to "previous" location, could be WCS or other (setvar "osmode" osm) ;; re-sets your recorded running osnaps (setvar "clayer" la) ;; re-sets your recorded current layer (princ) ) ;; end of routine (princ)
Last edited by tedg; 2016-12-01 at 06:48 PM. Reason: spelling error
Thank you tedg friend. its working.
is this is possible for taking first line as "0" (with respect to least x or y coordinate) instead of selecting origin?
Thanks
Good morning Structo,
I'm not sure I understand, you want the first line to be "0" without selecting origin?
Just so you know, "Ordinate" dimensions sees "0" at the origin of the current coordinate system being used.
So that is why I have the routine ask for "origin" (because it isn't at that point already).
If it were me, while doing your work, I would put the line you want at "0" at "0,0" while in the World Coordinate System, and then you wouldn't need to select the origin.
The lisp routine would need to get adjusted, see below, I removed the "place origin" part:
Also attached a version of your "sample" drawing, you'll see the bottom of the first line is at "0,0" in the WCS, which is were it should be to do what you want to do.Code:(defun c:foo2 (/ lin la lr1) ;; defines function "foo2" (command) you can change to whatever you'd like, and (/ list of local variables) (setvar "ucsicon" 3) ;; sets your uscicon to on and at origin (setq lin (ssget)) ;; sets "lin" equal to what you select (you select all the lines you want dimensioned) (setq la (getvar "clayer")) ;; records your current layer and sets it equal to "la" (setq lr1 (tblsearch "layer" "Dim")) ;; searches for the layer named "Dim" and sets it equal to "lr1" (if (= lr1 nil) ;; if "lr1" not found (doesn't exist) it moves to the following function, if found, skips following function (command "-layer" "make" "Dim" "color" "6" "" "")) ;;makes the layer "Dim" because it wasn't found (command "-layer" "t" "Dim" "s" "Dim" "") ;; thaws and sets "Dim" layer current (command "_qdim" lin "" "ordinate" pause "") ;; runs the quick-dim command, ordinate dimensions, on the lines and origin you selected, (you need to place the dims) (setvar "clayer" la) ;; re-sets your recorded current layer (princ) ) ;; end of routine (princ)
Last edited by tedg; 2016-12-05 at 12:30 PM. Reason: added new routine and sample dwg
Hi tedg friend,
very good morning. yes exactly done as per my requirement. for vertical lines dimensioning is correct. but while applying for horizontal lines there is not developed from 0'-0". please have a look and kindly tweak.
Thank you.