Jump to content

Area field help


mjab8

Recommended Posts

Anyone can help me to fix my area field text which has an unexpected, strange 'Â' between m², eg. I would get a 123.5m² instead of 123.5m².

Drawing units in sq.mm, field text is in sq.meter.

I try to use this lisp for area of polylines by Jimmy B from jtbworld and added some of my custom lisp into it. Part of the codes that are not giving the result I wanted are as below.

 

(setq fieldformula ">%).Area \\f \"%lu2%pr1%ps[,m²]%ct8[0.000001]\">%")

..........

InsertionPoint
                 0.0
                 (strcat   "%<\\AcObjProp Object(%<\\_ObjId "
                   entObjectID
                   fieldformula)
 

Another thing is how can I have that m² is not part of the field. The field should only be the area value. I have tried many times to fix this field formatting but unsuccessful.

The text is Arial fonts and that ² is from character map Arial Superscript 2 (or Alt+0178). I am using Autocad 2020.

Thanks in advance anyone who can help me on these 2 issues.

 

\mjab8

Link to comment
Share on other sites

I used to use ASCII Alt+253 for ² to label square feet as ft² but ASCII isn't the standard anymore as it's characters were created for those in the US. 

After switching to Arial Narrow as my standard font the ² would no longer display correctly.

I decided to start using the abbreviation SF for square feet rather than ft² as feet squared is grammatically incorrect anyway.

Link to comment
Share on other sites

Thanks tombu. Tried Alt+253, there is no difference from Alt+0178. It used to work but not now.

 

The other question, how can I separate the m² from the area field? I have trouble splitting it from the field.

Link to comment
Share on other sites

Try changing 

(setq fieldformula ">%).Area \\f \"%lu2%pr1%ps[,m²]%ct8[0.000001]\">%")

to 

(setq fieldformula ">%).Area \\f \"%lu2%pr1%ps[, SM]%ct8[0.000001]\">%")

Format is [prefix,sufix]

Link to comment
Share on other sites

Unfortunate. Is there other way to have the ² ?

The SM works, but I hope to have the SM as not part of the area field when you the FieldDisplay=1.

The area value is a field, but I don't want the SM as a field. Is it possible to separate them in term of field.

Link to comment
Share on other sites

22 minutes ago, mjab8 said:

Unfortunate. Is there other way to have the ² ?

I made the switch because after switching to Arial Narrow it wouldn't work anymore.

It worked when I was using the AutoCAD font "TT Swis721 Lt BT"

Try the lisp again with a text style using  "TT Swis721 Lt BT" or another font.

Link to comment
Share on other sites

I can't find this font. I have tried some fonts randomly. None of them make the change I wanted.

 

Let me know how to take the SM out of the area field format. Thanks

Link to comment
Share on other sites

1 hour ago, mjab8 said:

I can't find this font. I have tried some fonts randomly. None of them make the change I wanted.

 

Let me know how to take the SM out of the area field format. Thanks

The TrueType Swis721 family of fonts are installed with AutoCAD. Your have to have that font.

Changing the text style isn't enough. You will have to recreate the labels with your original code once you have a text style that supports that ASCII character.

Link to comment
Share on other sites

5 hours ago, mjab8 said:

Let me know how to take the SM out of the area field format. Thanks

 

If I've understood what you're looking for, change:

(setq fieldformula ">%).Area \\f \"%lu2%pr1%ps[,m²]%ct8[0.000001]\">%")

To:

(setq fieldformula ">%).Area \\f \"%lu2%pr1%ct8[0.000001]\">%m²")

 

Link to comment
Share on other sites

Thanks Lee, it's now not part of the field. What is that %ps does?

 

Can you help me on the superscript 2 on the earlier part of the post, to remove the Â from m².

In fact I think we don't need the 'fieldformat'. The format can be in the insert field part of the code.

Great if you can help.

Link to comment
Share on other sites

21 minutes ago, mjab8 said:

Thanks Lee, it's now not part of the field. What is that %ps does?

 

Yes - you can observe this for yourself by examining the changes to the field code displayed within the standard AutoCAD FIELD command dialog upon applying various field formatting settings.

 

21 minutes ago, mjab8 said:

Can you help me on the superscript 2 on the earlier part of the post, to remove the Â from m².

 

Try:

(setq fieldformula ">%).Area \\f \"%lu2%pr1%ct8[0.000001]\">%m\\U+00B2")

 

Edited by Lee Mac
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...