SolidWorks, SolidWorks Technical Tips, SolidWorks Timesaving Tips, SolidWorks Tips and Tricks, Tips & Tricks

SolidWorks Add-in Toolbars and the SolidWorks API

SolidWorks Add-in Toolbars and the SolidWorks API

28 June, 2011

4 Comments
By default, toolbars in SolidWorks are only displayed when documents are open. In the SolidWorks user interface, you can change this behavior by clicking View >Toolbars and selecting the toolbar you want to display. Clicking View > Toolbars does not work with SolidWorks add-ins. Instead, to display an add-in’s toolbar when there are no open documents, you can add the following code to your add-in. NOTE: This code is written in C#; however, you can implement the same functionality in VB.NET and C++. In the ISWAddin::ConnectToSW method in your add-in, add the following calls:             string callbackFunction = “addinCallback”;             iSwApp.AddCallback(cookie, callbackFunction); After adding the previous code, add the callback to your add-in:         public bool addinCallback(int cmd, int data, int dsp)         {             return true;         } 

You may also like

4 Comments »

You must be logged in to post a comment.