Why you want to save the parasolid in the first step itself when you've the SW file and then again you save that file as SW file?
What I am tryig to do is this. In a solidworks part file, the roll back history is very large. Some of the features are redundant. The file size is quite huge. When I convert it to parasolid, and then back to solidworks the file size is literally down to half. Now, obviously I have lost all the history, which is OK to me. The real issue is with regards to the drawing file. All the referenced dimensions are now hanging.
I would like to know where within solidworks, are these references to Faces, edged, vertices etc. stored. I am hoping to capture this data before converting them into dump parts and subsequently re-attaching these values to the part internally. With this I presume my drawing dimensions will point to the correct entities of the new part without throwing an error even while being an extremely lean part.
What you are asking is technically possible via API but unfortunately this is not an obvious macro to do. I would suggest the following approach to resolve the task:
- Get the drawing you want to replace the part document
- Find all referenced entities of the dimensions (Annotation::GetAttachedEntities3)
- Markup all those entities with the unique names Entity::ModelName.
- Export part to parasolid (all attributes from step 3 will be stored in the parasolid)
- Import parasolid to part. Now you have dumb body and your drawing has dangling dimension, but all your face still have the attributes so you know which face is which
- Now fix your drawing and reset the entities using the Annotation::SetAttachedEntities.
Your solution seems close to my requirements. Getting a macro to do this would be really great. Unfortunately, I am not much well versed in API coding. Any help here would be greatly appreciated.
Thanks in advance !
I'm thinking he wants to find a way to save new parts backwards into an older version of SW
If you are trying to just remove the overhead or make the file lean,... another option is to do a "insert part".. but you will loose the existing links in the drawing...
otherwise, if you had planned ahead, you could have linked sketches using "insert part".. but unfortunetly it's too late, you will have to redo the dimensions.
the attached is a example.. and you hide the original part in another folder if you need to update the "insert part"... or you can break this link later if needed.
drawingpart-no-history.zip 249.3 KB
No there is no direct way to get the part history back from any parasolids model. You could use Featureworks to get some of the history/feature information back but it will not match the original Solidworks file history. And even when you use Featureworks any of the drawings that may have used the original Solidworks part will no longer be referenced properly to the new part you've created from the parasolids model.
If you are using SW16, you are now able to purge unused features.
WARNING ... Be aware that this function has a downside.
If you are okay with parasolid models but need the drawing to work, why not save your drawings as "detached drawing". The drawing will open without the model. A parasolid is difficult to be edited or modified. Maybe a you want to look into other options all together.
If you explain the reasons why you want to proceed as described then maybe some people can offer other ideas.