Results 1 to 2 of 2

Thread: Using block's x-coordinate to get station

  1. #1
    Member
    Join Date
    2010-07
    Posts
    25

    Question Using block's x-coordinate to get station

    I currently have my elevation view set up so that the x-coordinates correspond to the stationing along my structure and the y-coordinate corresponds to the elevations. I have a block that will insert the y-coordinate as it should. However, the x-coordinate requires some formatting so that it is shown properly (e.g. "10+00").

    I have an attribute equal to a the x-coordinate divided by 100 with the precision changed to 0. So, if my point is 1016.123, the formula converts that to 10. This field is followed by a plus sign and then another field. This last field is equal to the x-coordinate minus the x-coordinate converted as before, then times 100. The purpose being that if my x-coordinate is 1016.123, I would get 16.123 and my block attribute would reflect 10+16.123. The problem is that AutoCAD retains all of the x-coordinate's precision when subtracting and I end up with a result of 0. See attached for clarity - I know this last bit is hard to understand if you can actually see what's going on.

    I understand that I could subtract out 1000, but when my stationing is beyond 20+00, I will only be subtracting 1000 and my result will not be correct.

    Do any of you have another solution?

    Thanks!
    Attached Files Attached Files

  2. #2
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2007-07
    Location
    Jo'burg SA
    Posts
    4,344

    Default Re: Using block's x-coordinate to get station

    Sorry, it seems this is one of those "problems" with fields. They always use the floating point value (even if only displaying the integer). And unfortunately they don't have the mod operator (like Excel has), so you can't get a formula like this:
    Code:
    mod(<Field Value 1>, 100)
    Which would return 23.456 from 123785684234786324723.456 ... no matter how many digits to the left.

    Edit: Just found out that there is something like the round / trunc functions though. See attached.
    Attached Files Attached Files
    Last edited by irneb; 2012-05-23 at 11:57 AM.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. x,y coordinate block
    By Maverick91 in forum AutoCAD General
    Replies: 19
    Last Post: 2012-07-01, 10:00 AM
  2. excel coordinate based block insertion
    By canadianpaddler in forum AutoCAD Map 3D - General
    Replies: 5
    Last Post: 2008-08-23, 02:39 PM
  3. Station/Offset in a block...?
    By dfarris75 in forum Land Desktop - General
    Replies: 3
    Last Post: 2007-06-21, 03:44 PM
  4. Replies: 9
    Last Post: 2006-07-11, 11:09 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
  •