Creo Elements/Direct Modeling COM & .NET API

Creo Elements/Direct Modeling COM & .NET API - Add-in Wizard


The add-in wizard

The add-in wizard provides all the boilerplate code that is required so that Creo Elements/Direct Modeling can find and interact with your add-in. This way, you don't need to worry about the Creo Elements/Direct Modeling add-in infrastructure, but can start right away with your own code.

We are shipping add-in wizards with the .NET API SDK. The add-in wizards are available for Microsoft Visual Studio 2015. Previous versions of Visual Studio are not supported for compiling Creo Elements/Direct Modeling clients.

Installing the wizard

After installing the wizard, (re-)start Visual Studio. The installed wizard(s) should now be available via the "New project" command in Visual Studio.

Using the COM C++ add-in wizard

This add-in wizard is accessed via the "New Project" command in Visual Studio:

addin wizard

After pressing "OK", the wizard still lets you control some Basic Settings, but typically there is no need to change these preset values that are derived from your project name.

The wizard also lets you configure if and what type of UI integration you want your add-in to implement: You can also choose to have skeleton implementations of Optional Interfaces generated by the wizard. Deployment options lets you specify how your COM add-in will be deployed. These options are reflected in the generated *.rgs registry script (writing either to HKLM or HKCU) and in the generated Dll(Un)RegisterServer functions (registering the add-in type library or not). These options have been introduced to support COM add-in deployment on Microsoft Vista and Windows 7. More details can be found in the section about COM add-in deployment on Microsoft Vista and Windows 7.

One of the files that the wizard generates is a header file containing #import statements which refer to the type libraries shipped with Creo Elements/Direct Modeling, namely OsdmServer.tlb and OsdmObjects.tlb. Those #import statements do not specify the path of those type libraries; therefore, you will have to either add the path to the #import statements or extend the header file search path of the project.

The required type libraries can be found in the binNT subdirectory of the Creo Elements/Direct Modeling installation directory. On 64-bit platforms, the subdirectory name is binx64.

Using the C# add-in wizard

This wizard can be accessed via "New Project" -> "Visual C#" -> "CoCreate SDK"

addin wizard

In Basic Settings, make sure to specify a namespace. We suggest you use your company name in order to avoid namespace conflicts in customer environments.

As in the COM C++ wizard, you can configure UI integration options and Optional Interfaces options.

Click "Finish" to complete the wizard. This will create a new C# project with all the code necessary for your add-in to be usable by Creo Elements/Direct Modeling.

Before you can successfully compile the project, you need to resolve the open references to the Creo Elements/Direct Modeling object model .NET assemblies CoCreate.OsdmServer.dll and CoCreate.OsdmObjects.dll. They are located in the binNT subdirectory of the Creo Elements/Direct Modeling installation directory. On 64-bit platforms, the subdirectory name is binx64.

addin wizard