Alex
Alex

Reputation: 3181

Add Part to Design Programmatically in Solidworks 2016

I've been trying to build an importer add-in. The user can open a file that outlines the various modifications to be applied to a standard part. I would like to pick out the standard part from the toolbox, and insert it, but I've been having trouble figuring it out.

I started working with the Toolbox API, but then realized it's for managing the contents in the toolbox, not inserting them. I've read the intro documentation on the other APIs, but none seem appropriate.

However, I did notice that the toolbox itself is an add-in, so would that mean I'll have to somehow communicate with it from my add-in? Perhaps this is more suited for a programmatic macro? I'm open to other solutions. Aside from these ideas I'm completely lost.

Upvotes: 1

Views: 300

Answers (1)

Vlad
Vlad

Reputation: 843

I couldn't find anything useful in the API as well. As a possible solution I can suggest loading toolbox files directly, for me they are located around

C:\SOLIDWORKS Data 2016\browser\AS\pins\parallel pins\split pin as.sldprt

Alternatively if you need more control you can work with toolbox database directly. You can find it here

C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\Toolbox\data utilities\lang\English\swbrowser.sldedb

Note that for current version of Solidworks it's SQLite file db, for older solidworks version it's MS Access file db.

Upvotes: 1

Related Questions