See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Need help with a simple routine

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

    Arrow Need help with a simple routine

    Instead of using "_dimaligned" for angled dimensions, I like to rotate the ucs and use the "_dimlinear" command so I can regulate the extension lines (I hope that makes sense).

    I wrote a quick routine, but I'm sure it can be made better and cleaner.
    Instead of picking three points to rotate the ucs, I'd like to select a line at the correct angle and have the ucs rotate to that angle, and when done, go back to world.
    Or at least just pick two points for the angle

    Here's what I have, it works pretty good:
    Code:
    (defun c:da ()
    (command "ucs" "3" pause pause pause "") ;rotates the ucs
    (command "_dimlinear" pause pause pause "") ;create my angled dimensions string
    (command "ucs" "world") ;sets ucs back to world
    )
    (princ)
    Any Ideas?
    I'm sure this can easily be done better

    thanks

  2. #2
    Member
    Join Date
    2004-03
    Posts
    9
    Login to Give a bone
    0

    Default Re: Need help with a simple routine

    You can download the file from www.dwgtoolbox.com.
    Go to the Lisp page and download the file "picksnapang.lsp".

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

    Default Re: Need help with a simple routine

    Quote Originally Posted by tdaniel View Post
    You can download the file from www.dwgtoolbox.com.
    Go to the Lisp page and download the file "picksnapang.lsp".
    Thanks, I'll check it out.
    Maybe I can steal some of the code for setting the angle, I don't think changing the snap angle will do what I need.

    I'll let you know


  4. #4
    Member
    Join Date
    2004-03
    Posts
    9
    Login to Give a bone
    0

    Default Re: Need help with a simple routine

    Try obrotucs.lsp on the Lisp page at www.dwgtoolbox.com

  5. #5
    Member
    Join Date
    2005-01
    Posts
    8
    Login to Give a bone
    0

    Default Re: Need help with a simple routine

    (command "ucs" "e" pause)

    pick the line towards the endpoint of where you want the ucs origin to be. The ucs x-axis should then align with the line you've picked.

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

    Default Re: Need help with a simple routine

    Quote Originally Posted by Gerhardt.Nortje View Post
    (command "ucs" "e" pause)

    pick the line towards the endpoint of where you want the ucs origin to be. The ucs x-axis should then align with the line you've picked.
    Well I didn't know about that one!!
    Cool, thanks!

    This is much nicer:
    Code:
    (defun c:da ()
    (command "ucs" "e" pause "")
    (command "_dimlinear" pause pause pause "")
    (command "ucs" "world")
    )
    (princ)
    I may try to write a "while" statement so I can do more than one string at a time.
    Anyone have any ideas?

    Thanks

  7. #7
    Active Member
    Join Date
    2007-06
    Posts
    97
    Login to Give a bone
    1

    Default Re: Need help with a simple routine

    As a cautionary note:

    Using non-2D entities (Lines and Points) to set a UCS can cause problems. The information to set the Z direction is not readily apparent (see attachment).

    It shouldn’t be much of an issue with tedg’s routine as the UCS is promptly set back to World. Should drafting continue with this UCS, however, the technician should confirm that it is oriented correctly.

    We were plagued by 2D drafting morphing out of plane. The cause was finally traced back to our 3D =>2D workflow which generated lines coplanar to World, but with normals not aligned to World Z.
    Attached Files Attached Files

Similar Threads

  1. Simple Routine - Script
    By Bryan Thatcher in forum Dot Net API
    Replies: 2
    Last Post: 2011-04-19, 03:04 PM
  2. Simple routine to set user variables.
    By keelay711 in forum AutoLISP
    Replies: 8
    Last Post: 2010-08-17, 12:49 AM
  3. Simple Find Routine
    By ed.w.cler in forum VBA/COM Interop
    Replies: 0
    Last Post: 2009-05-14, 02:09 AM
  4. A simple routine
    By mert523 in forum AutoLISP
    Replies: 14
    Last Post: 2008-12-08, 05:32 PM
  5. Need a simple routine fast.. plz help
    By keelay711 in forum AutoLISP
    Replies: 2
    Last Post: 2005-02-14, 09:22 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
  •