Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Renaming Attribute Tags?

  1. #11
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Quote Originally Posted by bustr0giantcatfish974410 View Post
    PS: If this can be done with a script that would be much easier.
    That's actually the whole point of these lisps - otherwise (as the original post states) the BAttMan command can do this for you (one at a time).

    Any lisp code can be placed directly into a script, or you can load a LSP file from a script, or you can of course call any lisp defun from a script. You should see a script file as a file containing all the keystrokes you type into ACad's command-line. It's as if you tell acad, read the file as if it is the keyboard.

  2. #12
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    I've re-written my routine to use ActiveX. It now allows nested block references as well.

    The routine contains 2 commands:

    RenAttrSet
    This opens a dialog to create the list of OldName-NewName pairs, so you don't have to make these manually. On the left will be listed all the attributed blocks in the drawing, you add them to the list to be renamed (multiple selection with Shift/Ctrl+Click)
    capture_04032012_111701.png
    Then click on the block-name in the middle column, the existing attribute names will be shown in the right column. As you select any one of these, you can then enter the new name below. After clicking the Save button the right-column is updated to show the new name: <NewName>.
    capture_04032012_111740.png
    Once you've completed the list of attributes, click the OK button - this will then save these settings to a file so the same settings are available in the future on different DWG files.

    Some extra notes:
    The list of attributes shows even duplicate attributes in their order of appearance in the block. This is so you can rename (say) the 2nd of the duplicates to something else to make their names unique.

    Even if you have some block references with attributes not found in the definition, these attributes will be shown in the list. That way you can rename them before performing AttSync and loosing their contents.

    If you start the same command in another DWG, you can again add even the same blocks. This will append any extra attributes into the settings list - none of your old settings will be removed. In this way you can build up an entire library of fixing up your blocks, even with multiple differences in the same block across multiple DWGs.

    RenAttr
    This command reads that file created above and continues to rename all attributes accordingly in the current drawing. It doesn't ask you for anything, since it assumes you've already setup the settings before. If you haven't it won't do anything. This is the command you'd add to your script.
    Attached Files Attached Files

  3. #13
    100 Club
    Join Date
    2012-08
    Posts
    111
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Thanks irneb.
    I routine is just amazing. It's exactly i was looking for.

    Many Thanks for share.
    Cheers mate!

  4. #14
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    This is a very promising routine and I look forward to employing it here. Currently, I have two issues with this LISP routine and cannot use it.

    ISSUE ONE
    The filename is included in the Autoload statements in my ACADDOC.lsp. All other files appear to load as expected. As I am a newbie at LISP and as I now understand it from others, Autoload statements may be problematic with a LISP file that has various (sub)routines in it(?)
    QUESTION ONE
    What are my options in loading it?

    ISSUE TWO
    An error message is generated stating that the file is not in the support path. I stored this file along with other existing LISP files in one folder that is defined in the current AutoCAD support file path. The other LISP files run as expected.
    QUESTION TWO
    How do I get the routine to recognize the file path?

    Your prompt attention is appreciated.

  5. #15
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Glad it works for you. You're welcome.

    You can load lisp files in many ways: https://www.google.co.za/search?q=lo...ient=firefox-a

    Are you sure you didn't make a typing mistake? If the others load then it should at least find this one too, thus it should not error on "Could not find file".

  6. #16
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    To followup with my (2) issue question, I commented out the autoload line in my ACADDOC.lsp file and instead used the APPLOAD command. This routine loaded and ran/works as designed.

    Is there something inherently wrong in attempting to load this particular type of routine using the autoload statement?

    Is there an alternate method to loade this routine i.e. inside an ACADDOC.lsp or other support file besides relying on the native APPLOAD command?

  7. #17
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Could you post the autoload line you created? Maybe it's something incorrect? Otherwise you can simply change the autoload into a normal load.

  8. #18
    100 Club
    Join Date
    2012-08
    Posts
    111
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Hi irneb,

    Is it possible clear the name of the blocks in setting - Blocks Names?

    Thank in advance

  9. #19
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Quote Originally Posted by BILLYJOW View Post
    Hi irneb,

    Is it possible clear the name of the blocks in setting - Blocks Names?

    Thank in advance
    Basically you just need to delete the file called RenAttrib.DAT located in your (getvar "RoamableRootPrefix"). Otherwise attached version - note it clears all settings at once. Else you can try and edit that file through NotePad (or even better in VLIDE). It's basically just a text file containing lisp-like lists starting with the block's name, then containing ("OLD-Tagname" "New-TagName") sublists for each block.
    Attached Files Attached Files

  10. #20
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Renaming Attribute Tags?

    Or even better, I've added a button to remove selected blocks from the settings.
    Attached Files Attached Files

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. 2013: Xrefs and Attribute tags
    By gjh in forum AutoCAD LT - General
    Replies: 2
    Last Post: 2014-05-10, 09:49 PM
  2. Attribute Tags
    By RobertAitken in forum VBA/COM Interop
    Replies: 5
    Last Post: 2010-06-11, 11:01 AM
  3. Re-use attribute tags
    By nancy.beulens in forum AutoCAD General
    Replies: 8
    Last Post: 2009-12-29, 03:23 PM
  4. Renaming Tags
    By kenneth_white in forum AutoLISP
    Replies: 8
    Last Post: 2008-02-08, 10:52 PM
  5. Renaming Fields in Room Name Tags
    By caroline1772 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2003-09-04, 01:23 AM

Posting Permissions

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