In the earlier post about AreaText.LSP the result was in SQ. FT. Several users have asked how to get it in other formats like m², cm², etc.
Here is what you do. Draw a polyline. Run the FIELD command and select the Objects Field category>the Object Field name>Area Property and select the polyline. Make changes as you want to the Format, Precision and Additional Format.
Notice the result in Field expression.
Copy the text for example it can look like this:
%<\AcObjProp.16.2 Object(%<\_ObjId 2130314088>%).Area \f "%lu2%pr1%ps[,m²]%ct8[0.001]">%
What is maked bold green is what is the important part.
Now look at the code for AreaText.LSP. Change this row below in the code.
">%).Area \\f \"%pr2%lu2%ct4%qf1 SQ. FT.\">%"
Now pick the correct piece of the field expression so the code look like this instead using one decimal as precision, the conversion factor of .001 and the suffix m².
">%).Area \\f \"%lu2%pr1%ps[,m²]%ct8[0.001]\">%"
I've been having problems with getting the AreaText.lsp to work with AutoCAD 2010. Is anyone else experiencing the same problem? If so is there a fix?
ReplyDeleteIt should work with AutoCAD 2010. What is the problem?
ReplyDeletei don't know why - but it gives a wrong number... for example - instead of 190 sqm. --> 1.34 sqm.
ReplyDeletehow come?
It is probably because the factor is incorrect or because of different settings for units in the drawing. Try to run FIELDS manually and figure out what settings you need to use.
ReplyDeleteThe AreaText lisp I use allows me to select the pline and place the text, but then only displays 4 pound signs (####). Any ideas what lisp modification may fix this glitch? I'm using MEP 2009...
ReplyDeleteWhat happens if you use the FIELDS command, select the polyline and then try to get the area of it? You may also check the code at the bottom of the FIELDS dialog box and take note of what it says and if needed make adjustment to the lsp code.
ReplyDeleteThere is now an update available for 64-bit AutoCAD.
ReplyDeletehttp://blog.jtbworld.com/2010/10/areatextlsp-updated-for-64-bit-autocad.html
Can anyone help fix this error?
ReplyDeleteCommand: at
Select object: Select point: #
Not sure what this error could be. I would need to know more like AutoCAD version, if you used the code exactly as it is or if you modified it.
ReplyDeleteThis works really well for me. I have tried modifying to return the perimeter of the area but I get the error shown below. Any ideas?
ReplyDelete"Select object: Select point: ; error: bad argument type: stringp nil"
Thanks
Scott
Scott, What code change did you do?
ReplyDeleteHey,
ReplyDeleteHow can I use command AT to show the sum of multiple polylines instead of individual length of them?
See the ATM command. Use the latest LSP here https://jtbworld.com/autocad-areatext-lsp
DeleteHi Jimmy,
ReplyDeleteLove your code but wanted to let you know about a switch if you are using Civil 3d We normally use Survey Feet or International feet for our units in Civil so I had to change the %ct4 to %ct8 to get the units to work correctly.
I want to change Precision , look like this 28.00 Sq. Ft. But I want 28.000 Sq. Ft.
ReplyDeleteTo change from 2 to 3 decimals change precision %pr2 to %pr3.
ReplyDeleteStarting, this is a great lsp. I've been using it for Square Footage for a long while.
ReplyDeleteI was wanting to use this for 3 decimal; Acres(conversion factor: 0.00002295684 [or] 1/43560) which codes as...
%lu2%pr3%ps[, AC]%ct8[2.295683999999996E-005]%th44">%
When loaded...
AreaText.lsp successfully loaded.
Command: ; error: misplaced dot on input
I have attempted changing in brackets to 0.00002295684 with no success.
Suggestions?
Jack, what Field expression do you get if you manually change it as you want on a field? Did you try it exactly as that?
DeleteYes, As I mentioned earlier, but for more detail...
DeleteFeild category: Object>Object type: Polyline> Property: Area> Format: Decimal> Precision: 0.000>
Additional Format...Conversion Factor: 1/43560 > Additional text...Suffix: AC> Thousands: ','
Is this what your code change look like? (setq jtbfieldformula ">%).Area \f ""%lu2%pr3%ct8[2.295683999999998E-005]"">%")
DeleteOr: (setq jtbfieldformula ">%).Area \f ""%lu2%pr3%ps[, AC]%ct8[2.295684113865930E-005]"">%")
Delete