AutoCAD Civil 3D General

Reply
Active Member
hunterjr81
Posts: 6
Registered: ‎06-29-2011
Message 1 of 17 (2,856 Views)

Calc Area in Acres

2856 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)
)


*Expert Elite*
wfberry
Posts: 1,610
Registered: ‎09-05-2006
Message 2 of 17 (2,847 Views)

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

 

*Expert Elite*
Jeff_M
Posts: 3,959
Registered: ‎07-22-2003
Message 3 of 17 (2,844 Views)

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
Valued Contributor
Posts: 72
Registered: ‎10-15-2009
Message 4 of 17 (2,833 Views)

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
Distinguished Mentor
Posts: 814
Registered: ‎11-15-2005
Message 5 of 17 (2,821 Views)

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.

Active Contributor
dsigman
Posts: 28
Registered: ‎09-29-2010
Message 6 of 17 (2,812 Views)

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. 

Distinguished Mentor
Posts: 814
Registered: ‎11-15-2005
Message 7 of 17 (2,783 Views)

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.

Contributor
aecoursen
Posts: 18
Registered: ‎08-02-2010
Message 8 of 17 (2,777 Views)

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
v2014/64bit
Active Contributor
dsigman
Posts: 28
Registered: ‎09-29-2010
Message 9 of 17 (2,766 Views)

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.

Active Member
hunterjr81
Posts: 6
Registered: ‎06-29-2011
Message 10 of 17 (2,752 Views)

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.

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Civil 3D Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for AutoCAD Civil 3D helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Civil 3D

Twitter

Facebook

Blogs