Example of retrieve customization (SPRetrievePlugin) - Integration - Update 46 - Help - Hexagon

SmartPlant Integration .NET Help

Language
English
Product
Integration
Search by Category
Help
SmartPlant Foundation / SDx Version
10
Smart P&ID Version
9 (2019)
Smart Engineering Manager Version
10 (2019)

This example shows how the SPRetrievePlugInAssemblyTypeName registry value determines which implementation it executes. The example source code for retrieve customization is in the installation directory under \SP Test Tool\Source\SPCLTestToolWPF\SPCLTestToolCustomProcessSample folder.

Registry modifications must be entered correctly. Incorrect entries and values may result in serious damage to your system. You must back up any valued data before making any changes to the registry.

These classes in the example code demonstrate that one assembly can contain more than one implementation of retrieve customization, such as the following, each prefixed with SPCLTestToolCustomRetrieve:

  • AddObject

  • ModifyObject

  • DeleteObject

  1. In Registry Editor, locate the HKEY_LOCAL_MACHINE\SOFTWARE\Intergraph\Intergraph SmartPlant Client.NET registry key.

  2. Create a new registry key under Intergraph SmartPlant Client.NET, and call it CustomPlugIns.

  3. Create a new registry key under CustomPlugIns, and call it SP Test Tool.

  4. Under SP Test Tool, create a new string value called SPPublishPlugInAssemblyPath and change the value to <Full path including the filename of SPCLTestToolCustomProcessSample.dll> (for example, C:\Program Files\SmartPlant\SmartPlant Client.NET\SP Test Tool\SPCLTestToolCustomProcessSample\bin\debug\SPCLTestToolCustomProcessSample.dll).

  5. Under SP Test Tool, create a second new string value called SPPublishPlugInAssemblyTypeName and change the value to Intergraph.SPClient.SPCLTestToolCustomProcess.SPCLTestToolCustomPublishAddObject.

    SHARED Tip The Registry Editor should look like the following example:

    registry_editor_retrieve

  6. In SmartPlant Test Tool.Net, retrieve a document and review the details displayed in the progress window to confirm that SPCLTestToolCustomProcessSample added item P-008 as expected.

    SHARED Tip To review the details, use SmartPlant Foundation Desktop Client to show all relationships on the document you retrieve after the document is loaded.

  7. Open the TestN_Data.xml file.

    SHARED Tip SmartPlant Test Tool.Net writes the data in the retrieved document to a TestN_Data.xml file in the %TEMP%\SPTestToolRetrievedFiles\<SPF Site>_<SPF Plant>_<SP Test Tool Plant> folder.

  8. In the TestN_Data.xml file, look for the following XML node to confirm that SPCLTestToolCustomProcessSample added item P-0088 as expected.

<NonDrawingItem_F>

<IObject Description="Pump added in CustomRetrieve" Name="P-0088" UID="U10088"/>

<INonDrawingItem/>

NonDrawingItem_F>

See Also

SmartPlant Test Tool.Net source code
Build the example source code delivered with SmartPlant Client.Net
Example of publish customization (SPPublishPlugin)
Examples of Publish dialog box customization (SPCustomPublishDialog)