Areas from Polylines

Discussion in 'AutoCAD' started by sdaze, Apr 26, 2004.

  1. sdaze

    sdaze Guest

    Hi guys,

    Is there a way to get the area of a closed polyline through LISP? I looked at the association list and couldn't see the area or perimeter listed.

    Thanks,
    Shaye.
     
    sdaze, Apr 26, 2004
    #1
  2. After using the "AREA" command for selected entity or by inputting
    coordinates,

    (setq PL_AREA (getvar "AREA"))
    (setq PL_PERIMETER (getvar "PERIMETER"))
     
    Alan Henderson, Apr 26, 2004
    #2
  3. sdaze

    Devin Guest

    Or you could try...

    (setq obj (vlax-ename->vla-object (car (entsel "Select pline: "))))
    (vla-get-area obj)
    (vla-get-length obj)

    HTH,

    Devin
     
    Devin, Apr 26, 2004
    #3
  4. sdaze

    PG. Guest

    (vl-load-com)
    (setq ename (car (entsel "\nSelect an object")))
    (setq obj (vlax-ename->vla-object ename))
    (if (vlax-property-available-p obj 'Area )
    (setq area (vlax-get-property obj 'area))
    ;; else
    (princ "\nArea not available"))
    (if (vlax-property-available-p obj 'Length )
    (setq len (vlax-get-property obj 'Length))
    ;; else
    (princ "\nLength not available"))

    -PG.

    at the association list and couldn't see the area or perimeter listed.
     
    PG., Apr 26, 2004
    #4
  5. sdaze

    sdaze Guest

    Thanks Alan. That worked great. Thanks for the other posts guys.
     
    sdaze, Apr 27, 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.