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.
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.
Oops, my mistake. Didn't read the subject carefully enough, sorry.
Correct. But:
1) tools like
formatting link
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.
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.
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
formatting link
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.
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.