Batch Re-Name???

Discussion in 'SolidWorks' started by Ben, Jan 25, 2006.

  1. Ben

    Ben Guest

    I have a bunch of part numbers that are
    5055-01-1111 etc

    I want to change them to

    T-Rex-01-1111 etc

    any macro out there that will do this and keep all the links to the
    assemblies and drawings?

    I can do it in SW Explorer but this will take forever.

    Ben
     
    Ben, Jan 25, 2006
    #1
  2. Ben

    lmar Guest

    Don't know about macros but I have a T-Rex Screen Saver that shows a
    three-wheeled high performance motorcyle made in Canada.

    Same company?

    Len
     
    lmar, Jan 25, 2006
    #2
  3. Ben

    Ben Guest

    I wish.....
    Nope not the project I am working on, but would love to have one of
    those bad boys (god is that a sexy vehicle or what!) and / or work for
    the guys. I am in Canada too so if any T-Rex guys need some help, I can
    make your product better via my talents in structural design, tons of
    aircraft experience and aerodynamics.

    And now for the selfless plug for my new consulting company

    Ben

    www.Mountiain-Wave.ca
    403.831.0195
     
    Ben, Jan 25, 2006
    #3
  4. Ben

    George Guest

    Ben,
    You can always do it the old school way using DOS command REN for
    RENAME.

    First open a command prompt window;
    Start/All Programs/Accessories/Command Prompt

    Navigate to the folder that has all the 5055-01-1111 files in it using
    the Change Directory command CD:
    translation; rename all files begining with 5055- to T-Rex-
    example:
    5055-01-1111 --> T-Rex-01-1111
    5055-01-1112 --> T-Rex-01-1112

    The biggest pain is getting to the files directory. I Actually can
    right click on a folder and select command prompt and it opens DOS
    Command Shell right in the specific folder. But in order to do this I
    had an email that instructed you on how to add the function to the
    righrt click. I will look for it.

    Command syntax help files for DOS commands.
    Open a command prompt window and type
    or help rename

    C:\Documents and Settings\GReilly.ZOLLMED>help rename
    Renames a file or files.

    RENAME [drive:][path]filename1 filename2.
    REN [drive:][path]filename1 filename2.

    Note that you cannot specify a new drive or path for your destination
    file.

    ~George
     
    George, Jan 25, 2006
    #4
  5. Hi Ben,

    I'm not sure what OS you have but if it's XP:

    1) Swipe all the files in explorer (or alt select to get a group) that
    you want to rename

    2) Hit F2 (or RMB rename - F2 works for me)

    3) Change the first filename to look like what you want (change in
    middle end or beginning).

    4) Hit your mouse in the whitespace (unselect them)

    Voila! All of them are now renamed to the pattern defined in the first
    file.

    I found this little gem by accident one day.

    Later,

    SMA

    PS. If you need to do any hardcore remanipulation or filenames - (not
    straight-forward renames like above) I recommend a program called Take
    Command.
     
    Sean-Michael Adams, Jan 26, 2006
    #5
  6. Oops - didn't really read your post too well . . .

    This is a damned nice trick anyways that we all need sometimes - I
    missed your associativity need . . .

    You know - Explorer vs Explorer - I thought you meant Explorer, not
    Explorer . . .

    :)
     
    Sean-Michael Adams, Jan 26, 2006
    #6
  7. Ben

    CS Guest

    Actually that might work ok in conjunciton with the solidworks open
    dialog.

    Open SolidWorks
    File>Open
    Select a file with references and hit the references button.
    In the References dialog hit the select all button
    and then hit the replace button
    Replace 5055 with T-Rex
    Open the file and save.
    Repeat.
     
    CS, Jan 26, 2006
    #7
  8. Ben

    Ben Eadie Guest

    Simply awsome! this is the trick

    First I used Rename to change the names in the folder (i.e. in this case
    5055 to t-rex) you can get rename at
    http://www.1-4a.com/rename/download.htm <--- great free ware!

    Next is in the open dialog click (once) the new renamed top level
    assembly and then as below hit the references button, it will reference
    all the old 5055 numbers, select all button to the right and there is
    another button below that for find and replace CALLED REPLACE... hit
    this and change all the references from 5055 to t-rex

    VOILA!!
    FRIGGIN BRILLIANT!!!!!!


    You have saved me a ton of time thank you!


    when you open and
     
    Ben Eadie, Jan 26, 2006
    #8
  9. Ben

    Blair Sutton Guest

    Do any of these techniques restore the associativity between a part and
    a part drawing?
    Or is that restored when opening part drawing and finding the missing
    part file?

    Thanks for this discussion on renaming tricks. I've learned a bunch

    Thanks, Blair
     
    Blair Sutton, Jan 27, 2006
    #9
  10. Ben

    Blair Sutton Guest

    Do any of these techniques restore the associativity between a part and
    a part drawing?
    Or is that restored when opening part drawing and finding the missing
    part file?

    Thanks for this discussion on renaming tricks. I've learned a bunch

    Thanks, Blair
     
    Blair Sutton, Jan 27, 2006
    #10
  11. Ben

    Ben Eadie Guest

    Drawings stay associated if they are the same name at the part or
    assembly (the way I do things)
    i.e. 5055-01-0001.sldprt ---> 5055-01-0001.slddrw

    Actually...now that I think of it, the part where you open the top level
    assembly and change the association names should keep the link, I will
    have to give that a go later and test it.

    Ben
     
    Ben Eadie, Jan 27, 2006
    #11
  12. Ben

    CS Guest

    You can use a similar technique to reassociate a coppied drawing and
    part. Since a drawing file likely has only one reference either double
    click on the reference in the dialog discussed above and it will alow
    you to browse for the new file. Or you can slow double click and edit
    it textually. Then open and save the drawing.
     
    CS, Feb 1, 2006
    #12
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.