What Api function to know tie excel of a model .sldprt?

Discussion in 'SolidWorks' started by swPeter, Aug 7, 2005.

  1. swPeter

    swPeter Guest

    Hello,


    What Api function can I use for know the path excel file (.xls)
    vinculate to a model (.sldprt) without opening the Solidworks?

    Regards
     
    swPeter, Aug 7, 2005
    #1
  2. swPeter

    TOP Guest

    Go to SW API downloads and get "Automate interaction with Microsoft
    Excel, configurations in SolidWorks documents, and creation of
    SolidWorks drawings (VB)". There is a pretty complete discussion of
    excel to SW linkages.
     
    TOP, Aug 7, 2005
    #2
  3. swPeter

    swPeter Guest

    Thanks to respond, but there not this the answer to my question.

    I want to know if the model has a file tie .xls, before opening it with
    SolidWorks.
    And if it is certain, then, to know its Name and Path, to look for it.

    To pardon the language to me. I write only a little English.
     
    swPeter, Aug 8, 2005
    #3
  4. swPeter

    TOP Guest

    I am sure my Spanish is worse. :)

    Would this be a tie to a design table or to an excel file in general?

    We have somebody in the office that insists on making external design
    table files. It is a problem when checking in the files. At least in
    our case the excel file has the same name as the sldprt file.
     
    TOP, Aug 8, 2005
    #4
  5. swPeter

    swPeter Guest

    Yes, this a tie to a design table.

    I am making an automatization in silence of thousands of archives, and
    must take the first file "excel"(design table), before opening the
    model in SolidWorks. In general Information of the file it is not that
    detail. If "SolidWorks" does not find "excel" it shows an error
    message that I must avoid.

    I need that "SolidWorks" provides that information in a Api function,
    as does for example with "GetDocumentDependencies2" because "SoliWorks"
    has it.
     
    swPeter, Aug 8, 2005
    #5
  6. swPeter

    SWX-VAR-JP Guest

    There is no API call that will give you this information before the
    model document is opened in SolidWorks. One way to make this work
    would be to open the file that you are wanting to work with in Silent
    mode, then use DesignTable::FileName to get the location and name of
    the design table, then store this path, close SolidWorks model and
    ........
     
    SWX-VAR-JP, Aug 8, 2005
    #6
  7. swPeter

    TOP Guest

    Have you made some code where this actually works? I'm having a little
    trouble with it myself.
     
    TOP, Aug 8, 2005
    #7
  8. swPeter

    SWX-VAR-JP Guest

    I forgot one thing, you have to have used an external design table
    before the call works. So you can use the export design table to save
    it out first.
     
    SWX-VAR-JP, Aug 8, 2005
    #8
  9. swPeter

    TOP Guest

    I was trying to program the checks for an external design table and had
    some problems with getting DTType = DT.SourceType() to work properly.
    DT is a DesignTable object. DTType came up with all kinds of weird
    values like 28 and 95. Should be 1,2 or 3 if IIRC.

    swPeter would need to first check that an external design table was
    used and then use the .FileName method to obtain that information.
     
    TOP, Aug 8, 2005
    #9
  10. swPeter

    SWX-VAR-JP Guest

    You have to make sure that you have the type library and constant
    library referenced, or you could declare these constants in your
    program.
     
    SWX-VAR-JP, Aug 9, 2005
    #10
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.