Macro for batch replacing Design Table?

Discussion in 'SolidWorks' started by Bullman, Apr 20, 2006.

  1. Bullman

    Bullman Guest

    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
     
    Bullman, Apr 20, 2006
    #1
  2. Bullman

    Mr. Who Guest

    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!
     
    Mr. Who, Apr 21, 2006
    #2
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.