See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Arc length??? Any way to draw to an exact length?

  1. #11
    Woo! Hoo! my 1st post
    Join Date
    2015-04
    Posts
    1
    Login to Give a bone
    0

    Default Re: Arc length??? Any way to draw to an exact length?

    what's the command for this lisp routine? sorry i'm new to all these. thanks for the reply.

  2. #12
    Woo! Hoo! my 1st post
    Join Date
    2011-07
    Posts
    1
    Login to Give a bone
    0

    Default Re: Arc length??? Any way to draw to an exact length?

    Quote Originally Posted by Richard.Kent View Post
    The only way I know of is to draw the arc with the radius you want at a random length, then use lengthen to set the exact length.

    Or use a lisp routine like

    ;Written By: derek 'maverick' beals
    ;Version: a
    ;Date: 9-26-05
    ;Description: this lisp routine draws an arc at given length & radius

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Non-Standard Lisp Functions

    (defun rtd (r) ; Radians to Degrees
    (/ (* r 180.0) pi))

    (defun dtr (d) ; Degrees to Radians
    (/ (* d pi) 180.0))

    (defun tan (a) ; Tangent of variable (a) in Radians
    (/ (sin a) (cos a)))

    (defun sqr (a) (* a a)) ; Squares the variable (a)

    (defun fixx (realnum) ; Rounds the variable (realnum) to the next highest whole integer (opposite of the "fix" function)
    (if (> realnum (+ (fix realnum) 0))
    (setq realnum (1+ (fix realnum)))
    (setq realnum (fix realnum))
    )
    realnum
    )

    ;(setq variable (ssget)) - allows multiple picks in lisp

    ;(setq OS (getvar "osmode"))...(setvar "osmode" OS) - gets current O-snap settings @ front of lisp, then reestablishes them at the end

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Lisp Programming starts here


    (setq LENG (getdist "\nEnter length of arc: ")
    RAD (getdist "\nEnter radius of arc: ")
    CEN (getpoint "\nPick center point of arc: ")
    ANG (/ LENG RAD)
    ANG1 (/ (- PI ANG) 2.0)
    ANG2 (/ (+ PI ANG) 2.0)
    ARC (entmake (list
    (cons 0 "ARC")
    (cons 10 CEN)
    (cons 40 RAD)
    (cons 50 ANG1)
    (cons 51 ANG2)))
    )
    (princ)
    Hi Guys - this LISP does exactly what I want it to, but I can't get it to work unless I APPLOAD it every time I need it. If I type 'arc-length' which I assume is the command, it just says 'unkown command.' I'm no LISP expert, what am I doing wrong?

  3. #13
    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: Arc length??? Any way to draw to an exact length?

    Quote Originally Posted by mlb6d9763438 View Post
    Hi Guys - this LISP does exactly what I want it to, but I can't get it to work unless I APPLOAD it every time I need it. If I type 'arc-length' which I assume is the command, it just says 'unkown command.' I'm no LISP expert, what am I doing wrong?
    This lisp didn't have a command function, may have been part of a bigger routine or the author wanted it to run on appload.
    Anywho, you still need to appload it per session or add it to your startup suite or acaddoc.lsp, but I added "test" for the command you can change it to whatever you need.

    Code:
    ;;;CADALYST Tips & Tools Weekly  05/08/06	arc-length.lsp	(c) 2006 Derek Beals
    
    
    ;File Name: arc-length
    ;Written By: derek 'maverick' beals
    ;Version: a
    ;Date: 9-26-05
    ;Description:  this lisp routine draws an arc at given length & radius
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Non-Standard Lisp Functions
    (defun c:test () ;;<-added command defun
    (defun rtd (r) ; Radians to Degrees
      (/ (* r 180.0) pi))
    
    (defun dtr (d) ; Degrees to Radians
      (/ (* d pi) 180.0))
    
    (defun tan (a)  ; Tangent of variable (a) in Radians
      (/ (sin a) (cos a)))
    
    (defun sqr (a) (* a a)) ; Squares the variable (a)
    
    (defun fixx (realnum) ; Rounds the variable (realnum) to the next highest whole integer (opposite of the "fix" function)
    (if (> realnum (+ (fix realnum) 0)) 
        (setq realnum (1+ (fix realnum))) 
        (setq realnum  (fix realnum)) 
    ) 
    realnum 
    ) 
    
    ;(setq variable (ssget)) - allows multiple picks in lisp
    
    ;(setq OS (getvar "osmode"))...(setvar "osmode" OS) - gets current O-snap settings @ front of lisp, then reestablishes them at the end
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Lisp Programming starts here
    
    
    (setq LENG (getdist "\nEnter length of arc: ") 
    RAD (getdist "\nEnter radius of arc: ") 
    CEN (getpoint "\nPick center point of arc: ") 
    ANG (/ LENG RAD) 
    ANG1 (/ (- PI ANG) 2.0) 
    ANG2 (/ (+ PI ANG) 2.0) 
    ARC (entmake (list 
    (cons 0 "ARC") 
    (cons 10 CEN) 
    (cons 40 RAD) 
    (cons 50 ANG1) 
    (cons 51 ANG2))) 
    ) );;<-added closing parenthesis
    (princ)
    Last edited by tedg; 2020-10-15 at 03:15 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Draw arc by arc length
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2013-10-28, 02:32 PM
  2. How do I draw an arc of specific length?
    By ukdodger in forum AutoCAD 3D (2006 or below)
    Replies: 5
    Last Post: 2011-03-02, 10:18 PM
  3. LISP to draw polyline with specified segment length
    By bhughes.211978 in forum AutoLISP
    Replies: 8
    Last Post: 2010-08-31, 09:45 PM
  4. Draw arc using set length
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2006-11-09, 02:04 PM
  5. Draw an ARC by length, not cord length
    By melanie.santer in forum AutoCAD General
    Replies: 5
    Last Post: 2006-03-21, 04:35 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
  •