Customization of Fields

Discussion in 'AutoCAD' started by Jenna, Aug 5, 2004.

  1. Jenna

    Jenna Guest

    I found one tip on CAD Forum that discussed custom editing of fields to
    allow for some detailed options. The example on CAD Forum
    (www.cadforum.cz/cadforum_en/qaID.asp?tip=3676) heads in the direction I'm
    wanting, but doesn't give any further information on control codes, what
    they all are and how to make more use of them. For example, I want to do an
    area in architectural units rounded to the nearest integer, but I want to
    keep my units at a higher precision of 1/64th.
    Based on the tip, I used Notepad to edit the field and pasted into text to
    try things. However, once it's pasted, you can't edit it again without
    copying out to Notepad or something similar each time. It makes perfect
    sense that this custom editing should be an option in fields to get
    additional formatting, etc. Anyone have an idea whether this might be
    added, or available now somehow? Or anywhere someone could get a list of
    the control codes and what they do to really make fields customizable?
     
    Jenna, Aug 5, 2004
    #1
  2. Jenna

    Jenna Guest

    Thanks to Rob Fjerstad at Autodesk for providing me with a document
    regarding control codes and information on customization of the fields
    dialog box. I hope that others can make use of this information, as well; I
    have found it to be a lifesaver!
    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.



    Data type
    Category
    Format
    Options
    Description

    String
    Case formats
    TCx

    x is 1-4




    1
    Upper case




    2
    Lower case




    3
    First capital




    4
    Title case





    Examples:

    %tc1

    %tc4


    File name formats
    FNx

    x is 1-7




    1
    File path only




    2
    File name only




    3
    File path and name




    4
    File extension only




    5
    Not valid




    6
    File name and extension




    7
    File path, name, and extension





    Examples:

    %fn1

    %fn6%tc1

    Long
    Separate thousands
    TH

    Separates thousands using comma


    Byte format
    BYx

    x is 1-3




    1
    Bytes




    2
    Kilobytes




    3
    Megabytes





    Examples:

    %by1

    %.2fby3


    Boolean format
    BLx

    x is 1-4




    1
    True, False




    2
    Yes, No




    3
    On, Off




    4
    Enabled, Disabled





    Examples:

    %bl2

    %bl4%tc1


    Enum format
    ENx

    x is 1-6




    1
    Text alignment:

    Left, Center, Right, Aligned, Middle, Fit, Top left, Top center, Top
    right, Middle left, Middle center, Middle right, Bottom left, Bottom center,
    Bottom right




    2
    MText line spacing style:

    At least, Exactly




    3
    Hatch object type:

    Hatch, Gradient




    4
    Hatch style:

    Normal, Outer, Ignore




    5
    Hatch pattern type:

    User defined, Predefined, Custom




    6
    3d polyline type:

    Simple, Quadratic, Cubic





    Examples:

    %en1

    %en2%tc1

    Double
    acutPrintf formats


    All the printf formats supported by acutPrintf


    QFormats


    QFormats supported by acutPrintf


    Precision
    PRx

    x is precision which can be 0-8


    Format options
    QFx

    x is OR'd custom format flags and AcUt::QFormatBitFlags enum values




    0x1
    Don't convert inches to foot for Arch and Eng units.




    n
    OR'd AcUt::QFormatBitFlags


    Linear units
    LUx

    x is 1-6




    1
    Scientific




    2
    Decimal




    3
    Engineering




    4
    Architectural




    5
    Fractional




    6
    Use current database units (LUNITS sysvar)


    Angular units
    AUx

    x is 0-5




    0
    Decimal degrees




    1
    degrees/minutes/seconds




    2
    Grads




    3
    Radians




    4
    surveyor's units




    5
    Use current database units (AUNITS sysvar)


    Conversion
    CTx

    x is 1-4




    1
    Inverse the value (1/x)




    2
    Foot to inch (x*12)




    3
    Inch to foot (x/12)




    4
    Square inch to square foot (x/12*12)





    Examples:

    %lu1%pr2

    %au2%pr3

    %lu1%qf3072

    %lu1%pr2%qf3072

    %lu4%pr8%ct2%qf2816
     
    Jenna, Oct 14, 2004
    #2
  3. Oh... this is good stuff!

    --
    R. Robert Bell


    "Jenna" <stilesj AT nospam DOT com> wrote in message
    Thanks to Rob Fjerstad at Autodesk for providing me with a document
    regarding control codes and information on customization of the fields
    dialog box. I hope that others can make use of this information, as well; I
    have found it to be a lifesaver!
    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
     
    R. Robert Bell, Oct 14, 2004
    #3
  4. Jenna

    Doug Broad Guest

    Thanks for posting the info Jenna.
     
    Doug Broad, Oct 14, 2004
    #4
  5. Jenna

    RKLindner Guest

    thank you Jenna for posting that info!! Definitely helped with my question I had posted the day before..

    and thank you R. Robert Bell for sending me this way... much appreciated!
     
    RKLindner, Oct 15, 2004
    #5
  6. Jenna

    Jenna Guest

    Glad to help!

     
    Jenna, Oct 15, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.