mjab8 Posted April 16, 2021 Share Posted April 16, 2021 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 Quote Link to comment Share on other sites More sharing options...
tombu Posted April 16, 2021 Share Posted April 16, 2021 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. Quote Link to comment Share on other sites More sharing options...
mjab8 Posted April 16, 2021 Author Share Posted April 16, 2021 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. Quote Link to comment Share on other sites More sharing options...
tombu Posted April 16, 2021 Share Posted April 16, 2021 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] Quote Link to comment Share on other sites More sharing options...
mjab8 Posted April 16, 2021 Author Share Posted April 16, 2021 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. Quote Link to comment Share on other sites More sharing options...
tombu Posted April 16, 2021 Share Posted April 16, 2021 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. Quote Link to comment Share on other sites More sharing options...
mjab8 Posted April 16, 2021 Author Share Posted April 16, 2021 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 Quote Link to comment Share on other sites More sharing options...
tombu Posted April 16, 2021 Share Posted April 16, 2021 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2021 Share Posted April 16, 2021 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²") Quote Link to comment Share on other sites More sharing options...
mjab8 Posted April 16, 2021 Author Share Posted April 16, 2021 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2021 Share Posted April 16, 2021 (edited) 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 April 16, 2021 by Lee Mac Quote Link to comment Share on other sites More sharing options...
mjab8 Posted April 16, 2021 Author Share Posted April 16, 2021 Yes, just as I wanted. Thanks Lee for all the answer to my queries. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.