Results 1 to 3 of 3

Thread: Draw arc

  1. #1
    Member
    Join Date
    2011-02
    Posts
    17
    Login to Give a bone
    0

    Default 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.


    Please help me with some hints????

  2. #2
    Member
    Join Date
    2006-07
    Location
    Currently Vancouver BC
    Posts
    47
    Login to Give a bone
    0

    Default Re: Draw arc

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

    (while(setq ent (car(setq po(entsel "\nSelect an ARC/LINE"))))
    (setq po (osnap(cadr po) "END"))
    (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)))
    )
    (setvar "POLARADDANG" (rtos(radian->degrees ang)2 4))
    (command "_.LINE" poFrom (polar poFrom ang (getdist poFrom "\nDistance:"))"")
    (command "MATCHPROP" ent (entlast)"")

    )

  3. #3
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Draw arc

    Quote Originally Posted by krkeec763189 View Post
    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.


    Please help me with some hints????
    You may want to try this code:
    http://www.acadnetwork.com/topic-264.0.html

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

Similar Threads

  1. 2012: How to draw this ?
    By igones in forum AutoCAD General
    Replies: 4
    Last Post: 2012-08-17, 08:26 PM
  2. The...how would you draw this?!
    By still.james in forum Revit Architecture - General
    Replies: 15
    Last Post: 2009-09-18, 08:08 AM
  3. SVP - how do you draw them?
    By still.james in forum Revit Architecture - General
    Replies: 1
    Last Post: 2008-11-18, 03:08 PM
  4. Replies: 1
    Last Post: 2008-06-18, 03:05 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
  •