Cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an AddIn for Solid Edge using VB.NET?

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

 

Hello All,

 

You must have developed a few applications to customize Solid Edge using theOutProc approach in which you develop an application that is running as a separate exe on a user's machine. OutProc applications are difficult to interact with because the user has to switch between different windowsfrom Solid Edge to the custom application and back again. In this article, I will explain how you can use the InProc approach to customize Solid Edge. Since InProc applications are embedded within Solid Edge, they look better and are easier to interact with from a usability point of view. This InProc runs in the same process as the calling application (edge.exe). An AddIn is a DLL or Dynamic Link Library, which is a file format for holding multiple codes and procedures for Windows programs. You can create such an AddIn by following the steps given in this article. The AddIn will appear as a tab in Solid Edge. Please note that I am using snapshots from Visual Studio 2015 (Professional Edition) and Solid Edge 2019 in this topic. Dialog box shown on your may differ if you are using different version of Visual Studio and/or Solid Edge.

 

1.     Download template to create an Add-In using VB.NET

Siemens PLM has created a template for automation users who would like to create their own Add-In using VB.NET. You can download the template as shown in below steps.

  • Start Visual Studio in “Administrator” mode and click on New Project. Dialog box shown after step 1.2 will appear.
  • In below dialog box click on “Online” and search for “solid edge”. You will see few results as shown.NewProject.png
  • All the templates available have some description. Use SolidEdgeAdd-In with a user interface and then click on OK to download the template and create new project on your machine.
  • It will also prompt you to install the template on your machine. Please install it.
  • Save your project at some convenient location. While saving the project please make sure that the folder structure doesn't contain any spaces. Otherwise there are chances that your AddIn may not get registered if the dll path contain space.
  • The template that you have downloaded also contain references (SolidEdgeFramework and SolidEdgeConstants) in it.
  • Now right click on solution and select “Build” to build the dll. You should be able to see the progress in “Output” window at the bottom. To enable “Output” window go to View > Other Windows > Output window.
  • In this Output window you will get the path where the dll is built on your machine as shown in below image.OutputWindow.png

 

2. Register and unregister the AddIn

 

  • After building the dll successfully now it’s time to register it. You can register the dll by using below steps.
  • Click on start button in windows and type cmd to start command prompt on your machine. Make sure that you start command prompt in Administrator mode.
  • Use “CD C:\Windows\Microsoft.NET\Framework64\v4.0.30319” to goto v4.0.30319 folder on your machine.
  • Type regasm followed by path of dll. You can copy the path of dll from Output window.
  • You will see “Types registered successfully” message in command prompt.
  • To verify whether the AddIn is installed successfully or not goto Application Menu > Settings  Add-Ins. Following dialog box will appear.AddInMgr.png
  • If there are multiple add-ins with same name you can click on properties to know the location of that add-in so that you can unregister it.
  • To unregister the AddIn type “regasm <Path of dll> -u” on command prompt.
  • Now start Solid Edge to see the Add-In on your machine. That's All!!!
  • Once you could see the AddIn in Solid Edge you can write your own code for every button.

By following these steps, you have now successfully installed an add-in to Solid Edge which will allow you to easily add customized features and configure the program for your preferred use.