PDA

View Full Version : Customization of Fields - It is Possible!



stilesj
2004-10-14, 12:45 PM
Some of you may know that I submitted a question a while ago about custom formatting of fields. I know a number of other people have asked similar questions, so I hope this information will be most useful to everyone:
Thanks to Rob Fjerstad at Autodesk for providing me with a document regarding control codes and information on customization of the fields dialog box (the customization follows; I'll try to post the document as a reply, as it's not large, but makes this message too long.
I found out that you can directly edit the field format controls by opening for edit the XML file AcFields.fdc located in your C:\Document and Settings\<user>\Application Data\Autodesk\AutoCAD 2005\R16.1\enu\Support

I suggest you make a backup copy of this file just in case you need to restore it for some reason.

In your sample, if you search for Area down at line 698 you’ll see various formatting styles for the Object Area field strings. What I did as a sample was added the following in this section, at line 701:

<Format>

<DisplayName>My Area Format</DisplayName>

<FormatString>%lu2%ct4%qf1%PR0 S.F.</FormatString>

</Format>

When I then created a Object field with property Area I then had in the Format list my new entry called My Area Format at the top of the list. You could then deploy this updated AcFields.fdc file to the others AutoCAD seats in your company.

stilesj
2004-10-14, 12:48 PM
Sorry, didn't realize I could attach...here it is!

Thanks!

Mike.Perry
2004-10-14, 01:06 PM
Hi Jenna

Could you please attach the document directly to a post here within this thread....

:beer: Mike

mjfarrell
2004-10-14, 01:29 PM
Yes, please do post it as an attachment Jenna.
I just knew that there had to be a better way than
we came up with.

roelie
2004-11-05, 05:46 AM
Thanks for the list, it helps a lot, however I am a little irritated at the lack of tools for metric users. I can't see a way of converting from mm's to m's, but maybe I'm blind.

cadpoobah
2005-05-27, 01:48 PM
Is it possible to locate the acfields.fdc file on a server? I tried moving it to a folder on our shared server (which is in the ACAD search path), but it didn't like it. Is there a way to tell AutoCAD where to look for this file?

This sure would be convenient!

thomas-p
2005-05-27, 07:34 PM
Does anyone know of a way to have it convert the field area to acres, with in the field.

stilesj
2005-05-31, 02:38 PM
This didn't work for me, either...I have a file saved on the server that is pushed out to each person's local support path via their login script.

rgq
2006-02-23, 07:07 PM
This information is all good. But how does one create a new field or reference a field in a formula? Sometimes we have projects where the sheets are referenced by a dwg number instead of the actual sheet number. And both the sheet number and dwg number are displayed on the sheet. I am looking for a way to do this by use of fields instead of typing in each dwg number.

Opie
2006-02-23, 07:10 PM
This information is all good. But how does one create a new field or reference a field in a formula? Sometimes we have projects where the sheets are referenced by a dwg number instead of the actual sheet number. And both the sheet number and dwg number are displayed on the sheet. I am looking for a way to do this by use of fields instead of typing in each dwg number.
You can insert additional fields within the formula box. Try the right-click within that box to insert an adittional field.

I believe this is only for 2006.

avdesign
2006-02-23, 09:56 PM
This information is all good. But how does one create a new field or reference a field in a formula? Sometimes we have projects where the sheets are referenced by a dwg number instead of the actual sheet number. And both the sheet number and dwg number are displayed on the sheet. I am looking for a way to do this by use of fields instead of typing in each dwg number.

You could try adding a custom field to your title block or where ever you need it that references Sheet Set custom properties in the Sheet Set Properties, only issue it that is global not drawing specific. This may or may not Help.
Wish Sheets Sets gave you more custom properties that could be drawing dependent.

natan.zimand
2008-05-06, 07:17 AM
Thanks for the list, it helps a lot, however I am a little irritated at the lack of tools for metric users. I can't see a way of converting from mm's to m's, but maybe I'm blind.
i developed the field codes that work for me for metric drawings, you should be able to adjust them to get what you are looking for as well:


<Format>
<DisplayName>square meters</DisplayName>
<FormatString>%lu2%pr1%ps[, m2]</FormatString>
</Format>
<Format>
<DisplayName>square meters (cm dwg)</DisplayName>
<FormatString>%lu2%pr1%ps[, m2]%ct8[0.0001]</FormatString>

</Format>

CelesteBancos
2014-08-15, 08:34 PM
Thank you so much for sharing this, stilesj! I figured out how to make my own custom field format and it's great : )

CelesteBancos
2014-08-15, 08:37 PM
Thank you so much for sharing this, stilesj! I just made my own custom area format and it's so nice : )

Here's what I did in case anyone wants to use it:



<Format>
<DisplayName>Celeste's Area Format</DisplayName>
<FormatString>%lu2%ct4%qf1%TH44%PR0 sq ft</FormatString>
</Format>


It makes a nice simple area format like so: 4,567 sq ft

mbrandt5
2015-05-09, 10:22 PM
I'm not sure this is the appropriate forum but, I'd like to be able to get a text style used for fields.
I'd also like to be able to stack fractions in autocad fields.

What code would i edit in the file ACfield.fdc?

From what i read its written in XML but there is no XML help here and, since it may be autocad specific I didn't know if someone at an xml help site could actually help...

jaberwok
2015-05-11, 11:16 AM
I'm not sure this is the appropriate forum but, I'd like to be able to get a text style used for fields.
I'd also like to be able to stack fractions in autocad fields.

What code would i edit in the file ACfield.fdc?

From what i read its written in XML but there is no XML help here and, since it may be autocad specific I didn't know if someone at an xml help site could actually help...

See new thread - "text style/stacked fractions "

mbrandt5
2015-05-11, 12:06 PM
Well, I'm actually the one who started that thread...seeing that no one replied and people here seem pretty knowledgeable I figured I'd give it a shot.

Tom Beauford
2015-05-11, 01:58 PM
Well, I'm actually the one who started that thread...seeing that no one replied and people here seem pretty knowledgeable I figured I'd give it a shot.

When replying to your first post http://forums.augi.com/showthread.php?161619-text-style-stacked-fractions-in-fields-Acfield-fdc&p=1292640#post1292640
I suggested the AutoCAD Fields Forum as it made more sense than the Bridging the Gap: LISP -> .NET -> LISP Forum when I should have requested a moderator to move the thread.
Probably best if someone could consolidate all your posts to one thread.

jaberwok
2015-05-11, 04:49 PM
Well, I'm actually the one who started that thread...seeing that no one replied and people here seem pretty knowledgeable I figured I'd give it a shot.

within two minutes.

This IS a suitable forum and it was right to start a new thread.
I hope you get the answers that you need.

bmo_ca702567
2015-06-25, 05:38 PM
Sorry, didn't realize I could attach...here it is!

Thanks!


i developed the field codes that work for me for metric drawings, you should be able to adjust them to get what you are looking for as well:


<Format>
<DisplayName>square meters</DisplayName>
<FormatString>%lu2%pr1%ps[, m2]</FormatString>
</Format>
<Format>
<DisplayName>square meters (cm dwg)</DisplayName>
<FormatString>%lu2%pr1%ps[, m2]%ct8[0.0001]</FormatString>

</Format>


Thank you so much for sharing this, stilesj! I just made my own custom area format and it's so nice : )

Here's what I did in case anyone wants to use it:



<Format>
<DisplayName>Celeste's Area Format</DisplayName>
<FormatString>%lu2%ct4%qf1%TH44%PR0 sq ft</FormatString>
</Format>


It makes a nice simple area format like so: 4,567 sq ft

I've searched all over the "Interweb" for more information on these field codes, and keep ending up here, and a similar post where @stilesj (Jenna) posted on the Autodesk Forums (http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/customization-of-fields/td-p/1099201).

@stilesj (Jenna) attached a .doc with some information on the sytax; page two of this post. It doesn't contain qf codes - OR’d custom format flags and AcUt::QFormatBitFlags enum values.

Where do you find this?

You have "qf1". Ive seen other values such as "2816", and the .doc Jenna attached has an example with "3072". No one has come close to elaborating on this format code.

Also, @natan.zimand posted one that has a "%ps" format code. This isn't even in the attached .doc from Jenna. What is it?

Tom Beauford
2015-06-25, 08:22 PM
This thread helped me understand Fields a lot better years ago. Field format has changed a little over the years. Best way to figure them out is create what you want in the command's dialog box keeping an eye on the Field expression at the bottom. Make a change and observe the changes in the Field expression at the bottom.

The "%ps" wasn't part of the format back when Jenna started this thread it's for adding a Prefix and/or Suffix as in "%ps[prefix,suffix]"

The "qf1" which was limited to a couple preset scales has been replaced by %ct8[scalefactor] that you can set to any scale you like.

bmo_ca702567
2015-06-26, 10:04 PM
Thanks for that, Tom.