Using SolidWorks C# Add-in Wizard to Create Visual C# .NET Add-in
This topic describes how to use the SolidWorks
C# Addin Wizard to create Visual C# .NET add-ins in Microsoft Visual
Studio .NET 2005 or 2008. This topic also identifies and describes the
files generated by the wizard. Click a link to read that section.
NOTES:
The SolidWorks
C# Addin Wizard is included in the SolidWorks
API SDK.
If you have Visual Studio .NET 2005 and Visual
Studio .NET 2008 installed on your computer, select the version of Visual
Studio that you want to install the SolidWorks project templates. You
can only install the SolidWorks project templates in one version of Visual
Studio.
If the wizard fails to set the references to the
SolidWorks API, then you must add them manually:
Right-click the References folder in the Solution
Explorer.
Browse to your SolidWorks folder and select
sldworks.tlb, swconst.tlb,
and swpublished.tlb.
Creating a Visual C# .NET Addin using the SolidWorks
C# Addin Wizard
Click Start,
Programs, Microsoft Visual Studio 2008 or Microsoft
Visual Studio 2008.
- or -
Click Start, Programs, Microsoft Visual
Studio 2005 or Microsoft Visual
Studio 2005.
Click the New
Project button.
Select Visual
C# Projects in Project Types.
Select SolidWorks
C# Addin in Templates.
Enter the name of your project in Name.
Click OK.
Type the name of your add-in in Addin
Name.
Under AddinEvents,
select the events for which you want to listen:
SolidWorks
Events. Fired by the SolidWorks application.
Part Events.
Fired by individual part documents.
Assembly
Events. Fired by individual assembly documents.
Drawing Events. Fired by individual drawing documents.
Model View
Events. Fired by individual model views in each document.
It is recommended that you leave the SolidWorks Events check box selected
because:
Model views are created in individual documents.
To listen for a model view event, you must be listening to the basic document.
Thus, the Model View Events check
box is not available until you select at least one of these check boxes:
Part Events, Assembly
Events, or Drawing Events.
Under Addin
User Interface, select Create
Property Page to include an add-in PropertyManager page. This page
is displayed in the SolidWorks application and should contain controls
to extend the add-in's user interface.
Click Finish.
Wait for the SolidWorks C# Addin Wizard to set up
your add-in's source files and to locate your SolidWorks directory.
If the SolidWorks C# Addin Wizard
finds your SolidWorks directory, it automatically adds references to the
SolidWorks type libraries and creates the RCWs (Runtime Callable Wrappers).
Back
to top
Examining Visual C# .NET Add-In Files
These files are created by the SolidWorks
C# Addin Wizard:
Back
to top