Adjust value of number by given amount

Discussion in 'AutoCAD' started by Kieren, Jun 3, 2004.

  1. Kieren

    Kieren Guest

    Help neededvery quickly please - seriously short deadline!
    I have many levels on section drawings. All level info is dtext (ie 34.567). NOT BLOCK ATTRIBUTED.
    All values need to be decreased by a constant given amount (ie 0.075).
    Can I do a global subtraction/addition to text instead of changing each value seperatley? (ie 34.567-0.075=34.492)
    If anyone has a routine already I would be most grateful of it asap.

    Many thanks,
    ..::KIEREN::..

     
    Kieren, Jun 3, 2004
    #1
  2. Kieren

    Kieren Guest

    Sorted it!

    ..::KIEREN::..
     
    Kieren, Jun 3, 2004
    #2
  3. Kieren

    T.Willey Guest

    Kieren,

    Get all the text you want in a selection set, then step thru it one by with getting "assoc 1" of the text. Then subtract that value by a value you set, then with the answer substitute it back into the original text entity.

    Tim
     
    T.Willey, Jun 3, 2004
    #3
  4. Kieren

    wkiernan Guest

    Can you select only the text entities that need to be incremented? Here's a program I wrote to do something like this to a land survey drawing where there were a couple thousand elevation shots as TEXT entities, and I needed to change the datum. FIXDATUM asks you for how much you want to increment the number values, then in each TEXT entity among those you select, it looks for the first substring that looks like a number and increments that number by the value you entered, then it modifies the text value so it shows the number plus the increment value you entered earlier, displayed to the same number of decimal places as were originally there. For example, if I say I want to add 2.54 to the values, and I select four TEXT entities with these values:

    "hello"
    "12"
    "24.1"
    "30.1324 15.2"

    the new values are

    "hello"
    "15"
    "26.6"
    "32.6724 15.2"
     
    wkiernan, Jun 3, 2004
    #4
  5. Kieren

    Devin Guest

    The code for checking to see if it's a number is: (if (numberp (read "string
    goes here")) (then_do_whatever))

    HTH,

    Devin
     
    Devin, Jun 3, 2004
    #5
  6. Kieren

    Kelie Guest

    A little more info. would be helpful. For example, do all the text strings
    share a command pattern, e.g. "Elev.=34.567" or they are just strings with
    numbers?


    value seperatley? (ie 34.567-0.075=34.492)
     
    Kelie, Jun 3, 2004
    #6
  7. Kieren

    Kent Elrod Guest

    File sent, it is from Cadalyst.com.
    Kent

    value seperatley? (ie 34.567-0.075=34.492)
     
    Kent Elrod, Jun 3, 2004
    #7
  8. Kieren

    Kent Elrod Guest

    The command you suggest is quite different from what the poster was asking
    for. They wanted to increment existing numbers by a set amount. The ET you
    suggested creates but does not adjust existing text.

    From the ET help file.
    "TCOUNT - Adds sequential numbering to text objects. The numbering can
    appear as a prefix, suffix or replacement text. "


    Kent Elrod
     
    Kent Elrod, Jun 4, 2004
    #8
  9. Kieren

    Kent Elrod Guest

    Kal, I hit send before I was ready. I was trying to check the ET tool
    TCOUNT but the ET's aren't working on ABS today. You may be correct about
    that command working for what they needed. I can't confirm for myself, but
    my apologies if I was wrong in the other post.

    Kent
     
    Kent Elrod, Jun 4, 2004
    #9
  10. Kieren

    Kent Elrod Guest

    Kal
    The ET command TCOUNT will not do what the original poster asked for.
    Kent
     
    Kent Elrod, Jun 4, 2004
    #10
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.