Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swap Design Table File using VBA

Status
Not open for further replies.
Replies continue below

Recommended for you

How exactly do you want to swap the design table? (are there conditions built in?)

If you're doing it manually, wouldn't it be a bit simpler to create a parameter, and assign it to the configuration relaion in the design table?

In other words, create a parameter, make it integer, call it "ConfigNumber". Now, go to the "Relations" portion of the tree, drill down to your design table, expand the relations under it, until you find "Configuration." (Configuration=X) Create a formula on this parameter, and insert the new "ConfigNuber" parameter in the formula. Now, when you want to update it, no more opening the design table - just double click the parameter in the tree, change the number, hit enter, and wait for an update. Also, this should make it easier for you to automate, if you have the intention of doing so. (although I can't understand why, just based on your question)

I don't know if that's exactly what you're after, but I do hope that it helps.

---
CAD design engineering services - Catia V4, Catia V5, and CAD Translation. Catia V5 resources - CATBlog.
 
I understand what your saying, but i think you missed understood me. i don't want to switch the configuration row, i want to swap the excel file. for example:

I have two excel files, lets say Example1.xls and Example2.xls. Curently my design table is linked to Example1.xls. I can change the file to Example2.xls by right clicking on the design table in the product structure, selecting properties, selecting the file path button, and select Example2.xls to replace Example1.xls.

What I would like to know is how to do that step using a macro.

I know it sounds silly to want to do this and not just add another configuration row, but for other reason not relevant here, this is what i would like to do.

Thanks for any help you can give.
 
Without gettig overly specific about anthing else, for whatever reason - can you please explain why you want to swap the design table - specifically - by macro?

Yes, at first glance, the idea does sound silly. But for the sake of adding value to your time, and any who might respond to you - please do elaborate on the macro issue...

---
CAD design engineering services - Catia V4, Catia V5, and CAD Translation. Catia V5 resources - CATBlog.
 
To clarify on my statemet about issues not relevant here, i apologize if it came off as rude, i was just trying to avoid useless details.

i'll try to elaborate:

I have a configured assy with parameters linked to a design table. this assy and design table are templates, starting position. This assy will be configured into a discrete assy per a customers order. The customers specs are written to an excel file with the same format as the template design table but saved with a different name, a customer specific name. i would like to be able to programaticlly swap the template design table with the customer specific design table and be able to save the product off discretely. This way our template doesn't grow exponentially with all the customer orders.

Plane and simple i would like to swap the excel file that the design table is linked to with another excel file using a macro.
 
I wasn't trying to imply that you were being rude, either. To clarify, and to make it sound worse - even if your idea APPEARED silly, I don't question that you know what you're doing, hence don't really care what you do with it. (because I hate when people question my well laid plans, as if I hadn't already thought of the simple solutions first) I was agreeing with you, that other stuff was irrelevant - but what IS relevant, and what I'd still like to know, is how do you plan to fire off the macro? Is it interactive? Is it called up through the macro dialog?

Forgive me for being a clod; but what exactly is your vision for executing the macro? What is the event that triggers it?

---
CAD design engineering services - Catia V4, Catia V5, and CAD Translation. Catia V5 resources - CATBlog.
 
I plan on assigning a command button to it. That's step two though, need to know how to swap the files first. If i can't do that then there no need in wasting time figuring out how i want to trigger it.
 
I see.

At this point, I'm not sure why it would be worth the trouble of writing a macro, vs. using the Edit -> Links -> Replace function. (seems like exactly the same amount of work - you could even make a desktop icon for the function)

Sorry to have such an exciting discussion, only to come back to such a disappointing answer...

---
CAD design engineering services - Catia V4, Catia V5, and CAD Translation. Catia V5 resources - CATBlog.
 
Status
Not open for further replies.
Back
Top