Results 1 to 6 of 6

Thread: line from point in angle

  1. #1
    Registered JSandSO's Avatar
    Join Date
    Apr 2003
    Location
    Australia
    Posts
    13
    Downloads
    0
    Uploads
    0

    line from point in angle

    Hi,
    How do I draw a line with a certain lenght from an endpoint of an arc
    in the same angle as that endpoint if this was not the last object drawn.
    I'm trying to find a way not to have to trace the arc before.

    jsandso


  2. #2
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    396
    Downloads
    0
    Uploads
    0
    I draw line from the center of the arc to the end of the arc - then offset that line by the distance. Draw the line you want -then erase the two constructioin lines.

    Don't know a better way.

    Bill


  3. #3
    Registered JSandSO's Avatar
    Join Date
    Apr 2003
    Location
    Australia
    Posts
    13
    Downloads
    0
    Uploads
    0
    Thanks Bill,

    yes that's what I'm doing as well but I was hoping someone
    got a better idea or a small lisp prog. I'm just wondering as
    this is a standard function in other cad programs. Just can't
    believe AutoCad has no function for that.

    jsandso


  4. #4
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    396
    Downloads
    0
    Uploads
    0
    JSandSO
    Try this lisp function. No guarantee it works every case.
    Bill

    (defun arcln ()
    ;draws a line tangent to end of arc
    (setq E (ENTSEL "\nSELECT ARC NEAR END TO DRAW TANGENT LINE: "))
    (setq lineln (getreal "\nENTER DISTANCE "))

    (setq el (entget (car e)))
    (setq arcctr (cdr (assoc 10 el)))
    (setq pickpt (car (cdr e)))
    ;determine end of arc to use
    (setq ang1 (cdr (assoc 50 el)))
    (setq ang2 (cdr (assoc 51 el)))
    (setq arcrad (cdr (assoc 40 el)))
    (setq p1 (polar arcctr ang1 arcrad))
    (setq p2 (polar arcctr ang2 arcrad))
    (if (< (distance pickpt p1) (distance pickpt p2))
    (setq EndToUse 1)
    (setq EndToUse 2)
    )
    ; store end point
    (if (eq EndToUse 1)
    (setq p3 (polar p1 (- ang1 (/ pi 2)) lineln))
    (setq p3 (polar p2 (+ ang2 (/ pi 2)) lineln))
    )
    ;draw line
    (if (eq EndToUse 1)
    (command "line" p1 p3 "")
    (command "line" p2 p3 "")
    )
    )


  • #5
    Registered buscht's Avatar
    Join Date
    Nov 2003
    Location
    United States
    Posts
    634
    Downloads
    0
    Uploads
    0
    Please keep in mind, I learned AutoCad a long time ago and still like to type in commands instead of picking the icons.

    Enter "List" and pick the arc.
    This will show you information about the arc including the starting and ending angles.
    Remember these angles. Autocad draws arcs in a counterclockwise manner so you should be able to tell which angle is which.

    Now enter the "LINE" command and pick the endpoint of the arc as your start point.


    Your next point should be entered like this, length of line<endangle+90 Depending upon your numbers here is an example. Let's say the ending angle of the arc is 221 degrees and you want a 15" long line

    15<311.

    That's all there is to it.

    There may be faster and better ways, but this seems to do what you want.

    If the line goes the wrong way, then subtract 90 instead of adding.


  • #6
    Registered JSandSO's Avatar
    Join Date
    Apr 2003
    Location
    Australia
    Posts
    13
    Downloads
    0
    Uploads
    0
    wjbzone,
    you are the best, thank you very much for that lisp.
    It does exactly what I was looking for.

    JSandSO


  • Similar Threads

    1. G-Code to DXF
      By WayneHill in forum OpenSource Software
      Replies: 216
      Last Post: 05-20-2013, 10:28 PM
    2. Visual Basic Controller Project
      By dwwright in forum Visual Basic
      Replies: 29
      Last Post: 02-14-2011, 02:24 PM
    3. point data in autocad
      By trubleshtr in forum General CAM Discussion
      Replies: 3
      Last Post: 03-11-2005, 06:32 AM
    4. angle cuts
      By coolman in forum General Metalwork Discussion
      Replies: 1
      Last Post: 01-23-2005, 12:33 AM
    5. Tool tables
      By Nimrod in forum Mastercam
      Replies: 4
      Last Post: 11-24-2003, 03:31 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.