Connect to SmartPlant Foundation.
The design tool should call this method before calling any other method on this interface, except Register.
Arguments
Name |
Data type |
Input/output |
Description |
---|---|---|---|
sSPFURL |
String (maximum 128 characters) |
Input |
SmartPlant Foundation URL |
sSPFPlant |
String (maximum 254 characters) |
Input |
SmartPlant Foundation Plant name |
sSPFProjectUID |
String (maximum 128 characters) |
Input |
SmartPlant Foundation Project UID. This is the unique ID that identifies the project. Tools get this ID when the WBS document is retrieved from SmartPlant Foundation. A WBS document is a published document in SmartPlant Foundation that describes all the projects (and their Work Breakdown Structure) defined in SmartPlant Foundation. This argument is optional; only if the connection is being made in the context of a project. |
SSPFProjectName |
String (maximum 256 characters) |
Input |
SmartPlant Foundation Project Name. It is the name of the project in the WBS document. This argument is optional; only if the connection is being made in the context of a project. |
SSPFUserID |
String (maximum 32 characters) |
Input |
SmartPlant Foundation login user ID. |
sSPFPwd |
String (maximum 32 characters) |
Input |
SmartPlant Foundation login password. |
sToolID |
String (maximum 32 characters) |
Input |
Design tool name. For example, Smart P&ID. |
sToolAdapterProgID |
String |
Input |
ProgID of the design tool adapter, i.e., the ProgID of the tool’s adapter implementation that supports the IEFAdapter interface. |
oToolParameters |
IEFToolParameters |
Input |
Collection of tool parameters that in turn will be passed to the tool adapter. Arguments tool Site, tool Plant, and tool workgroup file of the IApplication.Register method, as well as any other tool specific parameters, can be passed using this argument. |
oToolDocs |
IEFToolDocs |
Input |
Interface pointer to the tool implementation object that supports the IEFToolDocs interface. Tools must instantiate their implementation object before calling this method. |
bFileMode |
Boolean |
Input |
Optional argument to indicate whether Publish/Retrieve To File mode should be turned on. TRUE turns on Publish/Retrieve To File. Default is FALSE. |
Return Value
0 if method is successful.
A negative number if method fails. (Check the LastErrorMessage property for error message.)
If the method fails because it is attempting to connect to a project whose status does not allow connection, the negative return value is equal to SPFConnectionFailedBecauseOfProjectStatus plus a value that indicates the project's status. SPFConnectionFailedBecauseOfProjectStatus is an enum in eErrorValues. The project status value added to SPFConnectionFailedBecauseOfProjectStatus is one of the enums in SPFProjectStatus. Both eErrorValues and SPFProjectStatus are part of SchemaCompInterfaces in SchemaComponent.Tlb (Intergraph - EF/SC Component Interfaces).
For example, if the method fails because it attempts to connect to a project with merged status, the method returns a value equal to SPFConnectionFailedBecauseOfProjectStatus + Merged.
The following table shows the Connect return value for different SmartPlant Foundation project statuses. The table also shows the value of the CurrentSPFProjectStatus property after the Connect call. The CurrentSPFProjectStatus property is set when connection is successful, or if the connection fails because of the project status.
Project status in SmartPlant Foundation |
Value returned by Connect call |
CurrentSPFProjectStatus property |
---|---|---|
Created |
-2147220834 (Failure) |
SPFProjectStatus.Created |
Active |
0 (Success) |
SPFProjectStatus.Active |
Completed |
0 (Success) |
SPFProjectStatus.Complete |
Merged/Finished |
-2147220831 (Failure) |
SPFProjectStatus.Merged |
Cancelled |
0 (Success) |
SPFProjectStatus.Cancelled |
Terminated |
-2147220829 (Failure) |
SPFProjectStatus.Terminated |
Comments
If the project arguments are not passed in the Connect method, the connection will be made in context of the as-built plant (no project context).