Hi
Below is posted with kind permission from Charles Alan Butler ( CAB )...
Code:
;;;===================[ ArcByLength.lsp ]========================
;;; Author: Charles Alan Butler
;;; Version: 1.2 Nov. 17, 2005
;;; Purpose: To draw an arc from chord & arc length
;;; Restrictions:
;;; Arc length must greater than the chord length
;;;==============================================================
(defun c:arcbyl (/ arc_angle arc_length chord_length end_point arc_radius
start_point usercmd useros
)
(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq useros (getvar "osmode"))
;; x-x-x-x-x-x-x-x-x-x-x-x
;; returns the factor
;; x-x-x-x-x-x-x-x-x-x-x-x
(defun factor (arc_length chord_length / k n c e)
(setq k (/ chord_length arc_length))
(setq n 0)
(repeat 6
(if (= n 0)
(setq c (sqrt (- 6 (* 6 k))))
(setq c (- c (/ (- (sin c) (* k c)) (- e k))))
)
(setq e (cos c))
(setq n (1+ n))
)
c
)
;; |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
;; S t a r t o f R o u t i n e
;; |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
(if (and
(setq start_point (getpoint "\nPick start point. "))
(setq end_point (getpoint "\nPick end point."))
(setq arc_length (getdist "\nEnter arc length. "))
(and (setq chord_length (distance start_point end_point))
(or (< arc_length (* chord_length 6))
(not (prompt "\n** Warning, Large arc length used. **"))))
(or (> arc_length chord_length)
(prompt "\n*** Arc length too short. **"))
)
(progn
(if (setq arc_angle (* 2 (factor arc_length chord_length)))
(progn
(setq arc_radius (/ arc_length arc_angle))
(setvar "osmode" 0)
(command "_.arc" start_point "EN" end_point "A" (* 180.0 (/ arc_angle pi)))
)
)
(setvar "osmode" useros)
)
(prompt "\n*** Error in user input. Command terminated. ***")
)
(princ)
)
(prompt "\nArc By Length loaded, Enter ArcByL to run.")
(princ)
Have a good one, Mike