(how to) Replace TAG name

Discussion in 'AutoCAD' started by RoNin Warrior, Mar 17, 2005.

  1. I need to rename Attribute TAGs, like:
    location1 = location_1
    location2 = location_2

    This goes for ALL defined / inserted blocks.
    ... I do not know blocknames (could be anything)
    ... I do not know the total number of TAGs per block.

    So, preferably I need a routine which will check each block, to see if there is 1 or more attribute TAG which starts with 'location' & (only) if there is text behind 'location', I need to insert the '_' in between.

    ... but I really don't have a clue how to do it.

    so all help on this will be greatly appreciated!
     
    RoNin Warrior, Mar 17, 2005
    #1
  2. RoNin Warrior

    BillZ Guest

    Hi RoNin,

    I'm a little unclear on the intent of the change:

    When you say TAG that starts with 'location' are you talking about the Tag Value = location or the TAG Name?

    In between what?

    Bill
     
    BillZ, Mar 17, 2005
    #2
  3. RoNin Warrior

    The Real JD Guest

    I never saw an answer to the reason why...

    I've found that i had to take out dashes and underscores from tagnames so
    that the global attribute editor would work properly. That command has saved
    me tonnes of time, but the "-" & the "_" hindered its usage.

    I'd like to see code to REMOVE "_" from attribute names. :)


    there is 1 or more attribute TAG which starts with 'location' & (only) if
    there is text behind 'location', I need to insert the '_' in between.
     
    The Real JD, Mar 20, 2005
    #3
  4. "the reason why" is easy.

    I'm using 3rd party software (ARX) for creating page references. However, their was a problem with devices which could have multiple references.

    With the latest update they resolved this problem, but, that change requires me to update ALL those blocks. (Talking thousands of DWG's here!!!) ... adding the "_" resolves (part of) the problem, they say.

    I just follow ;)
     
    RoNin Warrior, Mar 21, 2005
    #4
  5. RoNin Warrior

    BillZ Guest

    I'd like to see code to REMOVE "_" from attribute names. :)<<<

    Command: (setq str "position_1")
    "position_1"

    Command: (vl-string-subst "" "_" str)
    "position1"


    HTH

    Bill
     
    BillZ, Mar 21, 2005
    #5
  6. RoNin Warrior

    The Real JD Guest

    Thanks Bill!

     
    The Real JD, Mar 22, 2005
    #6
  7. RoNin Warrior

    BillZ Guest

    Thanks Bill!<<<

    You're Welcome


    Bill
     
    BillZ, Mar 22, 2005
    #7
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.