Retrieving configuration information without solidworks app.

Discussion in 'SolidWorks' started by SRD, Jan 16, 2004.

  1. SRD

    SRD Guest

    Does any one know how to retrive configuration specific data from a sw
    part or assembly file for 2001 and later files ?
    I am interested in getting matrix and part and extracting parasolid
    bodies for each configuration.
     
    SRD, Jan 16, 2004
    #1
  2. Yes ;-)
    This is solved in 2 separate free macros:

    1) I just updated the "SplitConfigs" macro from
    http://www.dynabits.com/sw/free/macros/index.htm save Parasolids. (Normally
    it makes .sldprt with the other configs removed).
    2) The macro on http://www.cadml.org/writecadml.htm builds an XML file with
    all the "configuration specific data".

    If you tell me what the table should contain and promise to click the
    "PayPal" button, I can merge both in a specific macro just for you.
     
    Philippe Guglielmetti, Jan 16, 2004
    #2
  3. SRD

    Heikki Leivo Guest

    Subject: Retrieving configuration information without solidworks app.
    Interesting, I would be very pleased to know how this could be done...
    Unfortunately, the answer to the original question is that SW does not seem
    to give the specification of the SW files. Therefore, reading SW files
    without SW application requires that you manage somehow to guess how the
    data is arranged in SW files. SW files are OLE compound files, so it should
    be relatively easy read them, but only if you knew what to do with the data.

    Some of the data, such as custom properties (except configuration specific
    ones) and the preview image can be retrieved without SolidWorks.

    -h-
     
    Heikki Leivo, Jan 17, 2004
    #3
  4. Oops, my mistake. Didn't read the subject carefully enough, sorry.
    data.

    Correct. But:
    1) tools like http://www.codeproject.com/macro/ssfview.asp can help to
    guess.
    2) tools like Rhino's native SW importer do it.
    Another approach could be to re-use DLLs from the (free) SW Viewer or
    Explorer, but I'm afraid the license prohibits this...

    back to SRD's original post : Why do you want to do this ? What is your real
    goal ?
    Sometimes the most obvious path is not the shortest.
     
    Philippe Guglielmetti, Jan 18, 2004
    #4
  5. SRD

    Heikki Leivo Guest

    Interesting, indeed. By using such tools you can apparently see that the
    configuration-specific data is there, awaiting to be read... I have seen a
    VB library, which makes it possible to read the structure of OLE compound
    files in VB, so in theory it should be possible to read the data.... But,
    without any information how the data is arranged in the streams, it would be
    rather difficult to actually do something with the data.

    -h-
     
    Heikki Leivo, Jan 18, 2004
    #5
  6. SRD

    rocheey Guest

    Does any one know how to retrive configuration specific data from a sw
    I'm assuming you mean doing it without Solidworks...

    It can be done, but it's gonna take a bunch of work. It will require a
    ..TLB
    that gives generic access to compound documents, and then you'll have
    to reverse-engineer the different stream formats for the different
    config-related changes made in different versions of SW.

    I used a .tlb from http://www.vbbyjc.com/index.htm

    Scroll to the bottom of the page to find the related link. This .tlb
    will return the document hierarchy, and the related streams as a hex
    dump. It works
    under any compound document I've tried it under, SW, Excel, etc.

    You'll be amazed at the amount of information SolidWorks stores there.
    I was able to cobble together code that successfully reads the config
    info
    from vers 99-2003, including alt config names, and a config's parent.
    However, the "UniCode" streams SW puts in there dont seem to be what
    Im used to
    running into,(some Unicode, some not, and in the same streams) and had
    to 'tweak' an existing unicode routine to fit.

    While I havent ported the routines for 2K4, 2K4 does seem to be a bit
    more 'normal' in its Unicode usage.
     
    rocheey, Jan 19, 2004
    #6
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.