Macro for batch replacing Design Table?

Apr 20, 2006 1 Replies

Hello,



Just wondering if there is a macro where you nominate an Excel file as a Design Table and then have it inserted into a selection of parts as a single batch operation?



Typically you would otherwise have to open each part, right click on existing Design Table icon in the Feature Tree (if it already has a design table in it), select Edit Feature, then select Source "From File" to select the Excel file.



Cheers



Bullman



Yeah, you should be able to use DesignTable::FileName to change the referenced excel file. So your macro would be pretty simple.

  1. Point it at a directory of parts
  2. Get list of all parts
  3. Open part and determine if it has a design table
  4. If so then call ModelDoc2::GetDesignTable and then DesignTable::FileName = "whatever you decide."
  5. Save the part
  6. Close the part

Tada!

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required