Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Formatting for Precision in Fields

  1. #1
    100 Club stilesj's Avatar
    Join Date
    2000-11
    Location
    Ohio
    Posts
    128
    Login to Give a bone
    0

    Question Formatting for Precision in Fields

    Can anyone tell me how to format for precision in fields? Here is an example:
    I have a horizontal line and I want to use a field to display the length of the line (or the angle, for that matter). It has a choice for the units, but those show a pretty high precision, such as 180.000000 for the angle. How can I get it to just say 180.
    Really, I'd like to use this for displaying the area of a polyline in SF, but I will want it to be whole numbers, without the decimal or fraction.
    Any ideas?

    I appreciate it!

  2. #2
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    I'm going to go look...
    first do your units, or LUPREC
    have any impact on the returned values?

  3. #3
    100 Club stilesj's Avatar
    Join Date
    2000-11
    Location
    Ohio
    Posts
    128
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    Yes, they do...that appears to be where the field is getting the information. If I change the precision of the units and regen, the field updates to those units.

    We like to keep our precision high so that errors in drafting are more obvious. But I want the fields to be less precise for this application...rounding to the nearest whole number. It seems a shame if you can't override this for the fields like you can for dimensions.

    If nothing else, I suppose we could change the units for that one drawing that displays all our square footages...but that would not be ideal.
    Thanks for looking into it, Michael!

  4. #4
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    Yes, it seems that if you set your units
    and then when you chose Object as the field
    and then the Object you want it to read the data
    from, you can chose curent units for it to display
    using those settings.
    Shame the formatting option isn't a little clearer,
    it looks to be the data in the string after ( /f u3%d)
    only that portion appears to be uneditable by the user.

  5. #5
    100 Club stilesj's Avatar
    Join Date
    2000-11
    Location
    Ohio
    Posts
    128
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    Thanks very much, Michael, but even with selecting current units while the precision is low, it will go high again if you change the units and then regen. Besides which I need the architectural format for area. Unless some custom editing can be done with diesel (I'll try playing with that some), or autodesk comes out with some quick add-on that allows overriding the precision, the units will have to be set to a low precision on the drawing for keeps.

  6. #6
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    Perhaps while 'working' in the file the units would be set very high.
    Then prior to plotting set then low and regen, this shouldn't impact
    your dimensions as that is controlled via the DIMSTYLE.
    I think you can concatonate the value returned by a Deisel expression.
    I'm still back there poking at them to see If they twitch.

  7. #7
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    OK the sysvar FIELDEVAL will help with the
    units regeneration issues to some degree.
    Also there is a cryptic line in the help file related to
    formating the field and units dislayed.
    Even though you can not edit the field expression
    shown in the lower disply window, it can help the user
    see how fields are constructed.
    This leads me to believe that one could replace the object ID
    within a generic filed expression that was configured to display
    that objects properties as the user requires despite
    the units setting in a file.
    I think this would need to be done in VBA or LISP
    as you would need to evaluate the objects ID and object type
    programatically and then select the correctly formatted mtext(field)
    to place for that object, probably aquireing and passing the objects
    rotation to the mtext expression such that the lable is properly
    oriented.

  8. #8
    100 Club stilesj's Avatar
    Join Date
    2000-11
    Location
    Ohio
    Posts
    128
    Login to Give a bone
    0

    Default Re: Formatting for Precision in Fields

    Thanks, Michael, I'll look into those suggestions!

  9. #9
    100 Club stilesj's Avatar
    Join Date
    2000-11
    Location
    Ohio
    Posts
    128
    Login to Give a bone
    0

    Smile Re: Formatting for Precision in Fields

    All right...it continues!

    I just found a paper I had printed off before with some good information in this direction...at this point I have no idea where I printed it from, but here's what it's got:
    Control codes are used in the fields for detailed options. You can edit these and just paste the whole field code into MTEXT to get the desired result. One example they give is like this:

    %<\AcObjProp Object(%<\_ObjId 2130038592>%).Area \f "%.0f">%
    which gives the area to 0 decimal places, regardless of the LUPREC setting.

    However, it's still not in square feet so I started playing with the codes that do, but haven't gotten anywhere yet. Here's the code I start with based on our current units settings and object:

    %<\AcObjProp Object(%<\_ObjId 2130038592>%).Area \f "%lu2%ct4%qf1 SQ. FT.">%

    I'll play with it some more this afternoon, but I have to run to a meeting now and thought I'd throw it out there as an FYI and if you want to play with it.
    Enjoy! I'll let you/everyone know if I find the answer.
    Thanks!

  10. #10
    I could stop if I wanted to kwong's Avatar
    Join Date
    2002-11
    Posts
    270
    Login to Give a bone
    0

    Red face Re: Formatting for Precision in Fields

    Jenna,
    The info you printed off was from CadForum Cad Tip # 3676 - what I can't understand is the part about pasting it into MTEXT - how do I use that information? Can you explain it step by step? Thanks
    Kin

Page 1 of 2 12 LastLast

Similar Threads

  1. Formatting Fields in Keynote Table
    By dmcdonald.144953 in forum AutoCAD Fields
    Replies: 2
    Last Post: 2008-12-11, 06:00 PM
  2. Improved Formatting in Fields
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2008-10-12, 06:43 PM
  3. Fields - Area and precision
    By iainslie in forum AutoCAD Fields
    Replies: 6
    Last Post: 2006-08-25, 06:59 PM
  4. Formatting for Precision in Fields
    By 3D Jack in forum AutoCAD Fields
    Replies: 1
    Last Post: 2005-09-02, 10:41 PM
  5. formatting fields
    By Wanderer in forum AutoCAD Fields
    Replies: 9
    Last Post: 2004-06-25, 04:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •