C# Class SharpPlant.SharpPlantReview.SprApplication

Provides methods and properties for interacting with SmartPlant Review.
Inheritance: IDisposable
Mostra file Open project: phusband/SharpPlant Class Usage Examples

Public Methods

Method Description
Activate ( ) : void

Brings the SmartPlant Review application to the foreground.

Annotations_Add ( List annotations ) : void

Adds a list of annotations into the Mdb annotation table.

Annotations_Add ( SprAnnotation anno ) : void

Adds an annotation directly into the Mdb annotation table.

Annotations_Delete ( string type ) : void

Prompts a user to delete an annotation in the SmartPlant Review main view.

Annotations_DeleteAll ( ) : void

Deletes all the annotations from the active SmartPlant Review session.

Annotations_DeleteType ( string type ) : void

Deletes all the annotations of a specified type from the active SmartPlant Review session.

Annotations_EditLeader ( SprAnnotation &annotation ) : void
Annotations_EditLeader ( int annoNo ) : void
Annotations_Get ( int annoId ) : SprAnnotation

Retrieves the desired annotation from the Mdb text_annotations table.

Annotations_Place ( SprAnnotation &anno ) : void

Toggles annotation display in the SmartPlant Review application main window.

Creates a new data field in the Mdb text_annotations table. Returns true if the field already exists.

Prompts a user to place a new annotation in the SmartPlant Review main view.

Annotations_Select ( string type ) : SprAnnotation

Prompts a user to select an annotation in the SmartPlant Review main view.

Annotations_Update ( SprAnnotation anno ) : bool

Updates annotation data directly in the Mdb text_annotations table.

Annotations_Update ( object stateInfo ) : void

Updates annotation information directly in the Mdb text_annotations table, queueable from the threadpool.

Connect ( ) : bool

Connects to a running instance of SmartPlant Review.

Dispose ( ) : void

Releases the connection to the SprApplication.

Exit ( ) : void

Exits the SmartPlant Review application.

Export ( string vueName ) : void

Exports the current session to a VUE file format. Compatible only with SPR versions 9 and above.

ExportPdf ( int quality, string path ) : void

Compatible only with SPR versions 9 and above.

GetCenterPoint ( ) : SprPoint3D
GetObjectData ( int objectId ) : SprObject

Uses an Object Id to retrieve detailed object information.

GetObjectData ( string prompt ) : SprObject

Prompts a user to select an object inside SmartPlant Review. Retrieves object information from the selected object.

GetObjectData ( string prompt, bool singleObjects ) : SprObject

Prompts a user to select an object inside SmartPlant Review. Retrieves object information from the selected object.

GetObjectId ( string prompt ) : int

Prompts a user to select an object inside SmartPlant Review. Retrieves the Object Id of the selected object.

GetObjectId ( string prompt, SprPoint3D &refPoint ) : int

Prompts a user to select an object inside SmartPlant Review. Retrieves the Object Id of the selected object.

GetPoint ( string prompt ) : SprPoint3D

Prompts a user to select a point inside SmartPlant Review. Retrieves the physical point selected on screen.

GetPoint ( string prompt, SprPoint3D targetPoint ) : SprPoint3D

Prompts a user to select a point inside SmartPlant Review. Retrieves the physical point selected on screen.

GlobalOptionsGet ( int option ) : double

Gets the value of a specified global option in SmartPlant Review.

GlobalOptionsSet ( int option, int value ) : void

Sets the value of a specified global option in SmartPlant Review.

HighlightClear ( ) : void

Clears all highlighting from the main SmartPlant Review application window.

HighlightObject ( int objectId ) : void

Highlights a specified object in the main SmartPlant Review application Window

HighlightObject ( int objectId, Color color, int width = 2 ) : void
ObjectDataSearch ( string criteria ) : List

Searches through the active session for objects matching the supplied search criteria.

Open ( string fileName ) : void

Attempts to open the specified session in the fileName. Any active session will first be closed.

RefreshData ( ) : void

Refreshes the session data as if selected from the application menu.

SetCenterPoint ( SprPoint3D centerPoint ) : void
SetCenterPoint ( double east, double north, double elevation ) : void
SetEyePoint ( SprPoint3D eyePoint ) : void
SetEyePoint ( double east, double north, double elevation ) : void
SprApplication ( ) : System

Creates a new SprApplication class. Will automatically connect to a single SmartPlant Review process if available.

TakeSnapshot ( string imageName, string outputDir, SprSnapShot snapShot = null ) : Image

Captures the active SmartPlant Reviews session main view and writes it an image of the given filename and format.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CheckIsBusy ( ) : bool
GetDesignFiles ( ) : List
GetMdbDatabase ( ) : DataSet
GetMdbPath ( ) : string
GetNextAnnotation ( ) : int
GetNextTag ( ) : int
GetProcessId ( ) : IntPtr
GetSessionName ( ) : string
GetVersion ( ) : string
RefreshRow ( string tableName, object id ) : DataRow
RefreshTable ( string tableName ) : DataTable
SetNextAnnotation ( int annoId ) : void
SetNextTag ( int tagId ) : void
UpdateRow ( string tableName, object id ) : void
UpdateTable ( string tableName ) : void

Method Details

Activate() public method

Brings the SmartPlant Review application to the foreground.
public Activate ( ) : void
return void

Annotations_Add() public method

Adds a list of annotations into the Mdb annotation table.
public Annotations_Add ( List annotations ) : void
annotations List List of SprAnnotation to be added to the annotation table.
return void

Annotations_Add() public method

Adds an annotation directly into the Mdb annotation table.
public Annotations_Add ( SprAnnotation anno ) : void
anno SprAnnotation SprAnnotation containing the annotation information.
return void

Annotations_Delete() public method

Prompts a user to delete an annotation in the SmartPlant Review main view.
public Annotations_Delete ( string type ) : void
type string The string type of the annotation to delete.
return void

Annotations_DeleteAll() public method

Deletes all the annotations from the active SmartPlant Review session.
public Annotations_DeleteAll ( ) : void
return void

Annotations_DeleteType() public method

Deletes all the annotations of a specified type from the active SmartPlant Review session.
public Annotations_DeleteType ( string type ) : void
type string The string type of the annotations to delete.
return void

Annotations_EditLeader() public method

public Annotations_EditLeader ( SprAnnotation &annotation ) : void
annotation SprAnnotation
return void

Annotations_EditLeader() public method

public Annotations_EditLeader ( int annoNo ) : void
annoNo int
return void

Annotations_Get() public method

Retrieves the desired annotation from the Mdb text_annotations table.
public Annotations_Get ( int annoId ) : SprAnnotation
annoId int Unique Id of the annotation to retrieve.
return SprAnnotation

Annotations_Place() public method

Toggles annotation display in the SmartPlant Review application main window. Creates a new data field in the Mdb text_annotations table. Returns true if the field already exists. Prompts a user to place a new annotation in the SmartPlant Review main view.
public Annotations_Place ( SprAnnotation &anno ) : void
anno SprAnnotation Reference SprAnnotation containing the annotation information.
return void

Annotations_Select() public method

Prompts a user to select an annotation in the SmartPlant Review main view.
public Annotations_Select ( string type ) : SprAnnotation
type string The string type of the annotation to be selected.
return SprAnnotation

Annotations_Update() public method

Updates annotation data directly in the Mdb text_annotations table.
public Annotations_Update ( SprAnnotation anno ) : bool
anno SprAnnotation SprAnnotation containing the annotation information.
return bool

Annotations_Update() public method

Updates annotation information directly in the Mdb text_annotations table, queueable from the threadpool.
public Annotations_Update ( object stateInfo ) : void
stateInfo object SprAnnotation passed as an object per WaitCallback requirements.
return void

Connect() public method

Connects to a running instance of SmartPlant Review.
public Connect ( ) : bool
return bool

Dispose() public method

Releases the connection to the SprApplication.
public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Exit() public method

Exits the SmartPlant Review application.
public Exit ( ) : void
return void

Export() public method

Exports the current session to a VUE file format. Compatible only with SPR versions 9 and above.
public Export ( string vueName ) : void
vueName string The full path of the vue file to be exported.
return void

ExportPdf() public method

Compatible only with SPR versions 9 and above.
public ExportPdf ( int quality, string path ) : void
quality int
path string
return void

GetCenterPoint() public method

public GetCenterPoint ( ) : SprPoint3D
return SprPoint3D

GetObjectData() public method

Uses an Object Id to retrieve detailed object information.
public GetObjectData ( int objectId ) : SprObject
objectId int The ObjectId that is looked up inside SmartPlant Review.
return SprObject

GetObjectData() public method

Prompts a user to select an object inside SmartPlant Review. Retrieves object information from the selected object.
public GetObjectData ( string prompt ) : SprObject
prompt string The prompt string to be displayed in the application text window.
return SprObject

GetObjectData() public method

Prompts a user to select an object inside SmartPlant Review. Retrieves object information from the selected object.
public GetObjectData ( string prompt, bool singleObjects ) : SprObject
prompt string The prompt string to be displayed in the application text window.
singleObjects bool Indicates if SmartPlant Review locates grouped objects individually.
return SprObject

GetObjectId() public method

Prompts a user to select an object inside SmartPlant Review. Retrieves the Object Id of the selected object.
public GetObjectId ( string prompt ) : int
prompt string The prompt string to be displayed in the application text window.
return int

GetObjectId() public method

Prompts a user to select an object inside SmartPlant Review. Retrieves the Object Id of the selected object.
public GetObjectId ( string prompt, SprPoint3D &refPoint ) : int
prompt string The prompt string to be displayed in the application text window.
refPoint SprPoint3D The returned reference point representing the selected point.
return int

GetPoint() public method

Prompts a user to select a point inside SmartPlant Review. Retrieves the physical point selected on screen.
public GetPoint ( string prompt ) : SprPoint3D
prompt string The prompt string to be displayed in the application text window.
return SprPoint3D

GetPoint() public method

Prompts a user to select a point inside SmartPlant Review. Retrieves the physical point selected on screen.
public GetPoint ( string prompt, SprPoint3D targetPoint ) : SprPoint3D
prompt string The prompt string to be displayed in the application text window.
targetPoint SprPoint3D The point used to calculate depth.
return SprPoint3D

GlobalOptionsGet() public method

Gets the value of a specified global option in SmartPlant Review.
public GlobalOptionsGet ( int option ) : double
option int The integer value of the option to retrieve.
return double

GlobalOptionsSet() public method

Sets the value of a specified global option in SmartPlant Review.
public GlobalOptionsSet ( int option, int value ) : void
option int The integer of the global option to set.
value int The integer value to set the global option to.
return void

HighlightClear() public method

Clears all highlighting from the main SmartPlant Review application window.
public HighlightClear ( ) : void
return void

HighlightObject() public method

Highlights a specified object in the main SmartPlant Review application Window
public HighlightObject ( int objectId ) : void
objectId int Object Id of the of the entity to be highlighted.
return void

HighlightObject() public method

public HighlightObject ( int objectId, Color color, int width = 2 ) : void
objectId int
color Color
width int
return void

ObjectDataSearch() public method

Searches through the active session for objects matching the supplied search criteria.
public ObjectDataSearch ( string criteria ) : List
criteria string The search criteria used to find matching objects.
return List

Open() public method

Attempts to open the specified session in the fileName. Any active session will first be closed.
public Open ( string fileName ) : void
fileName string The full path of the session to load.
return void

RefreshData() public method

Refreshes the session data as if selected from the application menu.
public RefreshData ( ) : void
return void

SetCenterPoint() public method

public SetCenterPoint ( SprPoint3D centerPoint ) : void
centerPoint SprPoint3D
return void

SetCenterPoint() public method

public SetCenterPoint ( double east, double north, double elevation ) : void
east double
north double
elevation double
return void

SetEyePoint() public method

public SetEyePoint ( SprPoint3D eyePoint ) : void
eyePoint SprPoint3D
return void

SetEyePoint() public method

public SetEyePoint ( double east, double north, double elevation ) : void
east double
north double
elevation double
return void

SprApplication() public method

Creates a new SprApplication class. Will automatically connect to a single SmartPlant Review process if available.
public SprApplication ( ) : System
return System

TakeSnapshot() public method

Captures the active SmartPlant Reviews session main view and writes it an image of the given filename and format.
public TakeSnapshot ( string imageName, string outputDir, SprSnapShot snapShot = null ) : Image
imageName string Name of the final output image.
outputDir string Directory to save the snapshot to.
snapShot SprSnapShot SprSnapshot containing the snapshot settings.
return Image