Macro for batch replacing Design Table?

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

Reply to
Bullman
Loading thread data ...

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!

Reply to
Mr. Who

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.