×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Renaming all parts within an assembly, using a suffix/prefix etcà
2

Renaming all parts within an assembly, using a suffix/prefix etcà

Renaming all parts within an assembly, using a suffix/prefix etcà

(OP)
Hello all,

I have come across a problem when re-using assemblies.  I have this assembly which is complete with 75 parts & 8 sub-assemblies.  I need to use this assembly 4-6 times within a layout (main assembly/product).  This assembly (that I need to re-use) will basically stay the same; however, a few things will change within some of the parts (length, height thickness).  But, in order to keep these assemblies unique from one another I need to rename each part file name and each part property name in order to stay clear from any ‘part conflict name’ or identical part names over-writing one another.  
Is there anyway of getting around this problem?  Is there some way to rename all part names and property names by using some kind of “Save all as” command, saving all with a suffix/prefix etc…?

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Hi Bacvar,

If your runing CATIA under Windows OS, you can use a little free software called Advance Replacing Tools, which can do the things you want (meaning to put a suffix/prefix to your original files). This can be done without starting CATIA. After that, you have to recreate your assembly replacing your original files with the new ones. It will take a little time but I'm afraid you don't have any other choice. If somebody else know a better way, I will be glad to know about this.

To change each property name, I think it can be done only using a macro. I now that, because we use a software from TransCAT (called Q-Checker) which have this ability and I believe it works with a summ of macros which can solve different tasks.

Regards
Fernando

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

(OP)
Hi ferdo,

Thanks for the quick response.  I have found the software to rename the Catia file names, however, I am still unsure about how to run the macro to rename the property names along the spec tree.  Does this macro need to be purchased, downloaded or created?  Also, does this macro work the same way as the 'rename file' software, or does is add a number down the spec tree etc…?

Regards,
Bacvar

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Hi,

Check this link for Q-Checker: http://www.q-checker.com/ This  software can be purchased from them.

Another way is to launch a new product (start with new from..), and replace the old catparts with those one which you changed the names.

You can find replace command by clicking on right button on each catpart name and browse/point for the new one.




Regards
Fernando

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

hi,

Just some info if you want to start scripting...

I would look in that direction :

1) Get the list of the file (part) that need to be duplicated (part A, part B...)

2) Then open the first one, change partnumber and save as ( part A1...) loop till you have as many part as you have sub assy.

3) Get the next file (part B) and go back to step 2

end of first script

Second scipt

1) Get the list of all sub assy

2) Open sub assy1 and replace partA with partA1, partB with partB1... then save product

3) Open sub assy2 and replace partA with partA2, partB with partB2... save product

4) open next assy...

At the end all part are different from one sub assy to the other, and all sub assy are different also.


I didn't try to create those script but i know the first one is OK, for the second i didn't use "replace component" in a script yet.. so i dunno if it works fine.

Have fun

Eric N.

catiav5@softhome.net

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Eric N. method should work fine.

But you might try creating a product template of the sub-assy that you want similar but different.

Parameterize the parts that you know you want to change then stor this off into a catalog.
When you want to bring in one of these sub-assy's just insert it from the catalog.

You might also need a renaming macro at that point.

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Hi there

Here is the code for a macro which change the  property name of the CATpart (it will be like your file name).

Sub CATMain()
Dim win1 As String
   Dim product1 As Product
win1 = CATIA.ActiveWindow.Name
win2 = Split(win1, ".")
win1 = win2(0)
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Set partDocument1 = CATIA.ActiveDocument
Set product1 = partDocument1.GetItem(partDocument1.Name)

product1.PartNumber = win1

product1.Update
End Sub

Regards
Fernando

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

(OP)
Hello All,

Thanks for all the input.
Fernando, I tried your code for creating the macro.  When I try to run the new macro, a Microsoft Visual Basic window opens which says "Run-time error… and gives me the option to 'END' or 'DEBUG'.
Do you know what this means, and do you know why I'm not allowed to run the macro?

Thanks for all the help.

Regards,
Bacvar  

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Hi Bacvar,

This macro works fine for me. I've forgot to mention taht it was made in CATIA v5r11.

Maybe in other versions this macro can hae some problems (its only a supposition).

You can try a debug and see what's going on

Regards
Fernando

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

(OP)
Hi Fernando,

I debugged the macro and when it was finished it pointed to the fourth line (win1 = CATIA.ActiveWindow.name) Does anything look wrong in that line?
I am running Catia V5R11 right now, so the macro should work for me.

Regards,
Bacvar

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Hi Bacvar,

I really don't know what to say. Everything looks to be OK and the macro work for me very well. Sorry, but I can't help you any more.

Regards
Fernando

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

(OP)
Hi Ferdo,

I've come back to my macro problem, and I thought I'd run it by you one more time, just to make sure I'm creating it properly.  So here's the procedure on how I tried to create the macro and run it.
1. I went to Tools/Macro/Macros…
2. Clicked on Create…
3. Set the Macro language to MS VBA, and then typed in a name for the new macro (Property rename).
4. Then my new macro name appeared in the list of available macros, so I clicked on it and selected 'Edit'
5. Visual Basic opened, so I copied your code that you gave me into the open screen.
6. Saved it and then exited.
7. Went back into Catia, went to Tools/Macro/Macros… clicked on my new macro name and selected 'run'.  And then the run time error appeared.
Am I doing the procedure correct on creating the macro or is this where I'm missing something?  

Thanks in advance
Bacvar

RE: Renaming all parts within an assembly, using a suffix/prefix etcà

Hi Bacvar,

Yes, everything is OK. I hope you understood that this macro is working for a catpart not for a catproduct.

First you have to use this macro for each catpart you want to change and after that you can replace components inside a catproduct.

I've tried to create something similar inside a catproduct but I've failed and for the time beeing I don't have enough time to solve the problems.

Regards
Fernando

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources