Endpoints of an arc

Discussion in 'AutoCAD' started by Rabbit, Sep 21, 2004.

  1. Rabbit

    Rabbit Guest

    How do you find the endpoints of an arc using lisp or vlisp. I need it in a
    form that is consistant with the assoc 10 & 11 of a line. Thanks
     
    Rabbit, Sep 21, 2004
    #1
  2. Rabbit

    Jeff Mishler Guest

    With standard lisp:
    Command: (entget (car (entsel "\nSelect arc: ")))

    Select arc: ((-1 . <Entity name: 40201160>) (0 . "ARC") (330 . <Entity name:
    40201038>) (5 . "77C2BFCE2783B594") (100 . "AcDbEntity") (67 . 1) (410 .
    "WHOLE
    SITE") (8 . "BNDY") (100 . "AcDbCircle") (10 19.0824 19.3569 0.0) (40 .
    2.25588) (210 0.0 0.0 1.0) (100 . "AcDbArc") (50 . 0.784747) (51 . 2.45344))

    Assoc 10 is the centerpoint, Assoc 50 is the startangle, Assoc 51 is the
    endangle. Use (polar) to calc the start & end points.....

    With ActiveX:

    Command: (setq arc1 (vlax-ename->vla-object (car (entsel "\nSelect arc:
    "))))

    Select arc: #<VLA-OBJECT IAcadArc 0a4adf04>

    Command: (vlax-get arc1 "startpoint")
    (20.6786 20.951 0.0)

    Command: (vlax-get arc1 "endpoint")
    (17.3399 20.7896 0.0)
     
    Jeff Mishler, Sep 21, 2004
    #2
  3. Rabbit

    Rabbit Guest

    Thanks Jeff. Works great either way.
     
    Rabbit, Sep 21, 2004
    #3
  4. Rabbit

    Adesu Guest

    Hi Rabbit, may be my code can help you

    ; sepa is stand for searching of start/end point of arc
    ; Design by Ade Suharna
    ; 22 September 2004
    ; Program no.75/09/2004
    ; Idea from Jeff Mishler <>
    (defun c:sepa (/ arc ob spoin spoinx spoiny epoin
    epoinx epoiny displayData)
    (vl-load-com)
    (setq arc (car (entsel "\SELECT ARC:"))
    ob (vlax-ename->vla-object arc)
    spoin (vlax-get ob "startpoint")
    spoinx (rtos (car spoin))
    spoiny (rtos (cadr spoin))
    epoin (vlax-get ob "endpoint")
    epoinx (rtos (car epoin))
    epoiny (rtos (cadr epoin))
    displayData (alert (strcat "\nSTART POINT ARC "
    "\n X =" spoinx
    "\n Y =" spoiny
    "\nEND POINT ARC "
    "\n X =" epoinx
    "\n Y =" epoiny
    )))
    )
     
    Adesu, Sep 22, 2004
    #4
  5. Rabbit

    MP Guest

    Adesu,
    Curious why you include the alert call in your setq group?

    thanks
    Mark
     
    MP, Sep 22, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.