I posted in another forum, but thought maybe I should come here to see what you all think.
Have any of you tried to get part/assembly bounding boxes via SW Document Manager? Is there a way to get the tessellation data, that can then be used to calculate a bounding box? If I need to, I can have my guys insert bounding box features into their files prior to checking in. This would then automatically insert the bounding box custom properties. Now that I think about it, this might be the best option, as I also need to take configurations into account. Anywho, DM will be able to get these custom properties, and I can be on my merry way.
My goal is to get bounding boxes for hundreds of parts, without opening, and store them in a shared location. The usage of this tool would be to do a high-level interference check on parts and assemblies being created/worked on across multiple teams.
I could be wrong here but I don’t think tessellation data can be obtained via the document manager. The document manager is designed to get you top level metadata about your documents without exposing proprietary elements of the SOLIDWORKS file format (Feature tree and its data). For that, SOLIDWORKS Corp expects you to use the API.
I do know, however, that you can get the tessellation data without opening SW. For that, you need to have an established partner status with SW so you can get access to that codebase. I have seen several products (3D viewers) that can display SW models.
@artem , thoughts?
Thanks for the response! I thought I’d seen on CodeStack’s site that it could obtain this data via DM, but I just can’t find any other reference to this.
If need be, I can just set up a quick macro to open all parts/assemblies then insert a bounding box feature. I’m slowly leaning towards this method as I can’t imagine how this tessalation data is stored with respect to configurations, and we use them liberally. I’d guess that the last shown solid bodies are stored? Way out of my element when it comes to 3rd party storage/data.
- Create a macro that inserts bounding boxes.
- Add custom properties for the width, height and depth.
- Read those values by document manager.
You prolly won’t need the document manager. Just store those values as soon as you get them from SOLIDWORKS to a spreadsheet.
Thanks, @AmenJlili. Think I’ll go with this solution. Would be the most robust.
Though I would still like to know how I’d be able to get the BBs without opening the document (if possible), and without having to input a bounding box. Hopefully Artem has a method!
I did get a reply on the 3DSwym forum from @artem.
“Document Manager provides an access to tessellation data (you need to check Tessellation option when requesting the DM key). As far as I understand there is no API in the Document Manager SDK to serve this feature rather you can use the DM key to use Display Lists example which extracts this data. This example was available before for download, but I think now it should be explicitly requested from the API Technical Support team. I think it is also using ZLib which might need a separate license. You might want to contact API Support for more information. Unfortunately I do not have experience with this feature.”
I’ve emailed API Support, and will update when I get a clear answer from them. Thanks again.
I did manage to get a response from API Support.
Unfortunately, we do not have any Document Manager APIs to insert or read bounding box information. I ASSUME we write that information in the model stream which isn’t accessible using Document Manager APIs. So, the answer to your question is, NO, we do not have anything like that yet.
But I do not see any reason for not providing it so I added an enhancement request on your behalf to provide a set of APIs for reading and inserting bounding box using Document Manager. Below are SPR details:
SPR 1218958: Need document manager APIs to insert (if possible) & read Bounding Box information
Well, that tessellation data option you selected while requesting the document manager key lets you read Parasolid stream information using GetPartitionStream Method (ISwDMConfiguration2) API. BUT, it just dumps data and you will need a Parasolid license & knowledge of Parasolid APIs to read bounding box information from it. Plus it won’t allow you to insert a bounding box in the SOLIDWORKS model. So, I don’t think that you will go for it.
Do @AmenJlili or @artem have any resources on parasolid APIs? I’d like to know more about the process of reading model data streams. I apologize as I can’t really know what to do with this information from API Support unless I’m educated in the topics involved. Definitely appreciate any documents you guys share with me.
Hmmm, that is interesting. If your read this page: http://help.solidworks.com/2019/english/api/swdocmgrapi/GettingStarted-swdocmgrapi.html it seems like the parasolid method is managed by geometry stream, while tessellation is different and only for display list dll (outside of dm sdk). If you have tessellation, you can calculate bounding box.
Yes, I do see that now…so, I should presumably have access to this DLL through my SW DM license key, as I also requested access to the tessellation data. I cannot seem to find the DLL on my local disk.