1. 0 Did you find this post helpful? Yes

## Draw arc

Hi

i have problem drawing arc.
scenario is :
user select line and my routine will draw arc. Line is tangent to arc.
Problem si how autocad declare start and end angle of the arc.

2. 0 Did you find this post helpful? Yes

## Re: Draw arc

(defun c:tn ( / ed ent po oldlay )

(while(setq ent (car(setq po(entsel "\nSelect an ARC/LINE"))))
(setq ed (entget ent))
(cond
((= (dxf 0 ed)"ARC")
(tnLine ent po)
)
((= (dxf 0 ed)"LINE")
(setq p1 (dxf 10 ed) p2(dxf 11 ed))
(if (equal po p1 0.001)
(command "LINE" p2 p1 "")
(command "LINE" p1 p2 "")
)
(entdel (entlast))
(setq oldlay (getvar "CLAYER"))
(command "ARC" "" pause)
(command "MATCHPROP" ent (entlast)"")
)
)
)

)

;;
;; Draw tangent line
;;

(defun tnLine ( ent po / obj poFrom ang StartP oldlay)
(setq oldlay (getvar "CLAYER"))
(setq obj (vlax-ename->vla-object ent ))
(setq StartP nil)
(if (not(equal (setq poFrom (vlax-safearray->list (vlax-variant-value (vlax-get-property obj 'StartPoint)))) po 0.0001))
(setq poFrom (vlax-safearray->list (vlax-variant-value (vlax-get-property obj 'EndPoint))))
(setq StartP T)
)
(if StartP
(setq ang (-(vlax-get-property obj 'StartAngle)(/ pi 2)))
(setq ang (+ (vlax-get-property obj 'EndAngle)(/ pi 2)))
)
(command "_.LINE" poFrom (polar poFrom ang (getdist poFrom "\nDistance:"))"")
(command "MATCHPROP" ent (entlast)"")

)

3. 0 Did you find this post helpful? Yes

## Re: Draw arc

Originally Posted by krkeec763189
Hi

i have problem drawing arc.
scenario is :
user select line and my routine will draw arc. Line is tangent to arc.
Problem si how autocad declare start and end angle of the arc.

You may want to try this code:

Specify 2 points and then point in the middle of your line
hth,

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•