Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Custom dimentioning by Lisp

  1. #1
    Member
    Join Date
    2016-10
    Posts
    31
    Login to Give a bone
    0

    Default Custom dimentioning by Lisp

    Hi friends,

    any possibilities for only dimension text above selected lines as shown in figure. please have a look.

    Thanking you,
    Best regards.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    Quote Originally Posted by Structo View Post
    Hi friends,

    any possibilities for only dimension text above selected lines as shown in figure. please have a look.

    Thanking you,
    Best regards.
    I don't know what you want to do with a lisp routine, but
    To have your dimensions look like the picture right, you need to use a different dimension method: dimordinate" setting your UCS at the intended "0,0" origin first.
    See attached files.

    Hope this helps
    Attached Images Attached Images

  3. #3
    Member
    Join Date
    2016-10
    Posts
    31
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    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.

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    Quote Originally Posted by Structo View Post
    Hi friend,
    thank you for response.i dont have 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.
    this is probably possible, maybe others can chime in and supply some direction.
    I don't have time right now, but if possible I will try some other time.

  5. #5
    Member
    Join Date
    2016-10
    Posts
    31
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    friend,
    Thank you for response. i look forward for your code.

    Thank you.

  6. #6
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    Quote Originally Posted by Structo View Post
    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.
    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

  7. #7
    Member
    Join Date
    2016-10
    Posts
    31
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    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

  8. #8
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    Quote Originally Posted by Structo View Post
    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:
    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)
    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.
    Last edited by tedg; 2016-12-05 at 12:30 PM. Reason: added new routine and sample dwg

  9. #9
    Member
    Join Date
    2016-10
    Posts
    31
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    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.
    Attached Files Attached Files

  10. #10
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Custom dimentioning by Lisp

    Quote Originally Posted by Structo View Post
    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.
    The same requirement applies, you need the end of the bottom line at coordinate 0,0 for this to work.

Page 1 of 2 12 LastLast

Similar Threads

  1. Custom Lisp Tracker
    By fletch97 in forum AutoLISP
    Replies: 41
    Last Post: 2019-02-02, 06:41 AM
  2. Lisp for custom linetype
    By rickquin651723 in forum AutoLISP
    Replies: 3
    Last Post: 2016-05-09, 12:16 AM
  3. Custom LISP Routine please!
    By Crask422 in forum AutoLISP
    Replies: 1
    Last Post: 2015-02-08, 06:24 PM
  4. Get SSM Custom Property Via LISP
    By BlackBox in forum AutoLISP
    Replies: 3
    Last Post: 2010-07-20, 08:30 PM
  5. dimentioning in legend views
    By Revit User in forum Revit Architecture - General
    Replies: 2
    Last Post: 2007-04-24, 01:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •