Design Table Problem

Discussion in 'SolidWorks' started by Dave V, Nov 15, 2005.

  1. Dave V

    Dave V Guest

    Howdee group,

    I have an assembly for which the geometry of individual parts is
    updated through design tables. The overall dimensions of the assembly
    always change, so I've devised a system to automatically update the
    parts as required: I use one "master" excel table to calculate the
    overall geometry of the assembly and individual parts, and then run a
    VB program which goes through all the parts to open each part's design
    table in order to update/pass information from the master excel table
    (when each design table is opened, it automatically updates from the
    master table and thus the part is updated). This works pretty well,
    except now I would like to make the parts generic so that one part can
    be used for different assemblies (which would be defined by different
    master tables).

    The problem I now have is that the design tables of each of the parts
    refer to the original master table I made for the first assembly. I
    can replace the excel references in each part, but then I would need
    to duplicate the parts for each new assembly design, and I would
    rather just keep one version of each part.

    Is there a way of creating some type of global variables which can (1)
    be updated from excel, and then (2) read by a part's design table when
    it is opened?

    - I suppose this might be more of an excel than a SW question...

    Thx a bunch.
     
    Dave V, Nov 15, 2005
    #1
  2. Dave V

    cadguru Guest

    Have you thought of controlling all your parts from 1 externally linked
    design table? This is built in functionality. You could repoint the parts
    to new externally linked tables fairly easily from within the parts or with
    a simple VB script.

    I may not completely understand the depth of what you have accomplished. It
    seems that you are jumping through some unnesasary hoops.

    Cadguru
     
    cadguru, Nov 15, 2005
    #2
  3. Dave V

    Dave V Guest

    Thanks for your reply Adam.

    What you've describe is essentially what I do now (I just described it
    in a bit more detail than maybe was necessary). I did make a VB
    script to automatically re-point all the parts - essentially just a
    search/replace of the path and filename for the external xls file.

    I guess I was trying to think of a more "elegant" solution - the VB
    script takes quite a while to update all the parts as there's a good
    number of them and they are relatively complex. I still have to open
    each part's design table before it updates anyway (VB script does that
    too), so I suppose it doesn't take that much more time to for the
    program do the string replace.

    I'm curious how others might have approached this problem.

    Cheers, David V.
     
    Dave V, Nov 16, 2005
    #3
  4. Dave V

    Tony Guest

    I haven't tried this, but can you change Excels external links to point to a
    different spreadsheet? I've done this manually but not through a program.
    Might be worth a try.

    Tony
     
    Tony, Nov 17, 2005
    #4
  5. Dave V

    Dave V Guest

    Yes you can. This works well...

    Dim ExcelSht As Worksheet
    Set ExcelSht = ExcelObj2.ActiveSheet
    retval = ExcelSht.Name
    ExcelSht.Cells.Replace What:=findstring, _
    Replacement:=replacestring, LookAt:=xlPart,
    MatchCase:=False
    Set ExcelSht = Nothing

    David.
     
    Dave V, Nov 18, 2005
    #5
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.