• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Civil 3D

    Reply
    Active Member
    hunterjr81
    Posts: 6
    Registered: ‎06-29-2011

    Calc Area in Acres

    1868 Views, 16 Replies
    07-07-2011 12:37 PM

    Hello,

     

    Before 2011 came along we had a lsp routine for acre that would give us the area of any polylines in acres. In 2011 this same routine does not work. I can enter in "acre" at the command line and it ask to pick polyline for area. When I click on the polyline it just says "nil"

     

    Anyone know why this is. The code we have for acre is below.

     

    (defun c:ACRE (/ )
            (setq pentity (car(entsel "\nPick polyline for area: ")))
            (command "area" "e" pentity)
            (setq area1 (getvar "area"))
            (setq acreage (/ area1 43560.0))
            (setq acre (rtos acreage 2 2))
            (setq art (strcat " = " acre " Acres" (chr 13)))
            (setq sqrft (strcat "Area = " (rtos area1 2 0) " SqFt"))
            (setq art_sqrft (strcat sqrft art))
            (PROMPT art_sqrft)
    )
    

    Please use plain text.
    *Expert Elite*
    Posts: 1,250
    Registered: ‎09-05-2006

    Re: Calc Area in Acres

    07-07-2011 01:02 PM in reply to: hunterjr81

    I cannot help on your code but just offer a plan B.

     

    Autocad's FIELD command can be a fairly easy method.

     

    Bill

     

    Please use plain text.
    *Expert Elite*
    Posts: 3,050
    Registered: ‎07-22-2003

    Re: Calc Area in Acres

    07-07-2011 01:07 PM in reply to: hunterjr81

    Add this line right above the last parenthesis:

    (princ)

     

    THe command works, the nil is returned by the lisp so it runs the result out of view. Adding the (princ) stops the nil from displaying.

    Jeff_M, also a frequent Swamper
    Please use plain text.
    Valued Contributor
    Posts: 72
    Registered: ‎10-15-2009

    Re: Calc Area in Acres

    07-07-2011 01:42 PM in reply to: hunterjr81

    I know the direct question was why doesn't the lisp work but....How about setting your default area label style for CreateParcelFromObject to something setup for acres and just create temporary parcels from the polylines with acre labels? Just a suggestion for using the capabilities of the software rather than deferring to old lisp routines.

    Civil 3D 2011
    Windows 7 Prof. x64
    HP Z400 Workstation
    Intel(R) Xenon(R) CPU
    W3550 @ 3.07GHz
    6.00 GB RAM
    Please use plain text.
    Valued Mentor
    Posts: 766
    Registered: ‎11-15-2005

    Re: Calc Area in Acres

    07-07-2011 02:18 PM in reply to: Maine-iac

    I totally agree with Maine-iac... use parcels to give the areas. The only catch is best practice is to not have overlapping lines when creating parcels. So, no overlapping closed polylines on top of each other. Otherwise, parcels are the ticket, IMHO.

    Please use plain text.
    Contributor
    dsigman
    Posts: 25
    Registered: ‎09-29-2010

    Re: Calc Area in Acres

    07-07-2011 02:36 PM in reply to: hunterjr81

    I went to the Lines/Curves menu and created a label I called AREA. It shows square feet and acres. I toggled the leader so it doesn't show. When I click on a closed polyline the label shows up on the place where I clicked. Then I drag the label to the center of the parcel.

     

    Sorry but I just don't like the way working parcels makes them act like a block that I can't do much with. And while I'm complaining, why did they take a perfectly useable mapcheck function and complicate it so that you have to click on the labels to run a mapcheck instead of picking a polyline? What if you're not ready for labels? It makes for uneccessary work. 

    Please use plain text.
    Valued Mentor
    Posts: 766
    Registered: ‎11-15-2005

    Re: Calc Area in Acres

    07-08-2011 07:37 AM in reply to: dsigman

    Great job on the closed polyline label. I would never have thought of that.

     

    Question... is the label dynamic? If you change the size of the polyline area, does the label update? Thanks.

    Please use plain text.
    Contributor
    aecoursen
    Posts: 14
    Registered: ‎08-02-2010

    Re: Calc Area in Acres

    07-08-2011 08:41 AM in reply to: castled071049

    Question... is the label dynamic? If you change the size of the polyline area, does the label update?

     

    Yes it does.  Works well when doing quantities.

    Andrew Coursen PE & LS
    v2012/64bit
    Please use plain text.
    Contributor
    dsigman
    Posts: 25
    Registered: ‎09-29-2010

    Re: Calc Area in Acres

    07-08-2011 09:24 AM in reply to: castled071049

    Yes it is dynamic. It works the same as any other label.

    Please use plain text.
    Active Member
    hunterjr81
    Posts: 6
    Registered: ‎06-29-2011

    Re: Calc Area in Acres

    07-08-2011 10:40 AM in reply to: Jeff_M

    Thanks Jeff_M!

     

    Works perfect now. Alot of the work I do involves editing lines and keeping boundaries under certain acres and I like to be able to do a quick acre check on anything. And guys I realize I can utilize the parcel feature but I love using this little lsp for a quick check on any boundaries. Its simple and easy.

     

    Please use plain text.