Curved line length
Curved line length
(OP)
How do I determine the length of a curved line? For instance, I need to determine the length along the curved line between two points on that line. I am using ACAD 2000 or 2004LT. I am also not well educated in using AutoCAD. Thanks for the help.





RE: Curved line length
(DEFUN C:DV3 (/ p1 p2 p3 p4 x1 x2 x3 y1 y2 y3 adj dx dy opp om ang rad arc ark) ; Dimension END to END along an ark
(SetVar "CMDECHO" 0)
(Setq om (GetVar "OSMODE"))
(COMMAND "Osnap" "END")
(setq p1 (getpoint "\nSnap to first END: ")
p2 (getpoint "\nSnap to second END: ")
)
(COMMAND "Osnap" "CEN")
(setq p4 (getpoint "\nPick a point on the arc: "))
(COMMAND "Osnap" "NON")
(setq p3 (getpoint "\nPoint to dimension location: ")
x1 (- (car p1) (car p4))
y1 (- (cadr p1) (cadr p4))
x2 (- (car p2) (car p4))
y2 (- (cadr p2) (cadr p4))
x3 ( / ( + x2 x1 ) 2.0000 )
y3 ( / ( + y2 y1 ) 2.0000 )
adj ( sqrt ( + ( * x3 x3 ) ( * y3 y3 )))
dx ( - x3 x2 )
dy ( - y3 y2 )
opp ( sqrt ( + ( * dx dx ) ( * dy dy )))
ang ( atan ( / opp adj ))
rad ( getvar "Userr2")
arc ( * rad ang 2.0000 )
ark (rtos arc)
)
(COMMAND "DIM1" "ANG" "" P4 P1 P2 P3 ARK P3)
(COMMAND "DIM1" "HOM" "L" "")
(COMMAND "DIM1" "TE" "L" PAUSE)
(SetVar "OSMODE" om)
(SetVar "CMDECHO" 0)
(princ)
)
RE: Curved line length
CODE
(defun C:DIMARC ( / pt1 pt2 cen a1 a2 D1 D2 p r oldOs)
(setq oldOs (getvar "OSMODE"))
(prompt "Pick 2 points on an arc - ")
(setvar "OSMODE" 512)
(while (not cen)
(setq pt1 (getpoint "1st pt: ")
cen (osnap pt1 "_CEN")
)
(if (not cen) (alert "Doesn't lie on an arc, retry")
(setq pt2 (getpoint cen " 2nd pt: ")))
);while
(setvar "OSMODE" 0)
(setq a1 (angle cen pt1) a2 (angle cen pt2) ad (abs (- a2 a1))
r (distance pt1 cen)
D1 (* r ad)
D2 (* r (- (* 2 pi) ad))
)
(prompt (strcat "\nArc length: " (rtos D1) ", complementar arc: " (rtos D2)))
(command "_DIMANGULAR" "" cen pt1 pt2 "_T" (rtos D1) pause)
(setvar "OSMODE" oldOs)
(prin1)
)
(princ "\nDIMARC command loaded.")
(princ)
____________________
Acad2005, Terramodel
RE: Curved line length
select line or arc, reports length
experiment with command options
hope this helps
Intel P4 3.0 GHZ
512 DDRAM
Win 2000 Pro
Autocad 14, 2002 with EP 2.3.1
RE: Curved line length