Configuring the code generator - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

Create your new custom code project in Visual Studio, and add any references to existing SmartPlant Foundation .dlls that are required.

It is important that the Root Namespace for the project is blank. This is so namespaces in generated code resolve correctly. To change this, right-click the project node in the Solution Explorer view and select Properties.

Compile your project to produce the .dll.

We need to configure the code generator with respect to our customization. We need to make it aware of our custom module and our custom schema. This is done in the Settings.xml file in the delivered Code Generator folder.

Using a text editor, open that file and look for the <ServerModules> section. Add a new child node for your custom module taking care with the exact path to your custom assembly…

<ServerModule path="C:\Inetpub\wwwroot\SPF40Server2005\bin\CustomModule.dll"/>

Next, look for the <SchemaFiles> section. Each of the child nodes are a schema file that the code generator will read during initialization. Just add a new node for your custom schema file taking care to use exact paths:

<SchemaFile shortname="Custom" path="D:\My Documents\MyProject\CustomSchema.xml"/>