C# Class SharpPlant.SharpPlantReview.SprApplication

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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode 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 méthode

Brings the SmartPlant Review application to the foreground.
public Activate ( ) : void
Résultat void

Annotations_Add() public méthode

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.
Résultat void

Annotations_Add() public méthode

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

Annotations_Delete() public méthode

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.
Résultat void

Annotations_DeleteAll() public méthode

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

Annotations_DeleteType() public méthode

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.
Résultat void

Annotations_EditLeader() public méthode

public Annotations_EditLeader ( SprAnnotation &annotation ) : void
annotation SprAnnotation
Résultat void

Annotations_EditLeader() public méthode

public Annotations_EditLeader ( int annoNo ) : void
annoNo int
Résultat void

Annotations_Get() public méthode

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.
Résultat SprAnnotation

Annotations_Place() public méthode

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.
Résultat void

Annotations_Select() public méthode

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.
Résultat SprAnnotation

Annotations_Update() public méthode

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

Annotations_Update() public méthode

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.
Résultat void

Connect() public méthode

Connects to a running instance of SmartPlant Review.
public Connect ( ) : bool
Résultat bool

Dispose() public méthode

Releases the connection to the SprApplication.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Exit() public méthode

Exits the SmartPlant Review application.
public Exit ( ) : void
Résultat void

Export() public méthode

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.
Résultat void

ExportPdf() public méthode

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

GetCenterPoint() public méthode

public GetCenterPoint ( ) : SprPoint3D
Résultat SprPoint3D

GetObjectData() public méthode

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.
Résultat SprObject

GetObjectData() public méthode

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.
Résultat SprObject

GetObjectData() public méthode

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.
Résultat SprObject

GetObjectId() public méthode

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.
Résultat int

GetObjectId() public méthode

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.
Résultat int

GetPoint() public méthode

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.
Résultat SprPoint3D

GetPoint() public méthode

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.
Résultat SprPoint3D

GlobalOptionsGet() public méthode

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.
Résultat double

GlobalOptionsSet() public méthode

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.
Résultat void

HighlightClear() public méthode

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

HighlightObject() public méthode

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.
Résultat void

HighlightObject() public méthode

public HighlightObject ( int objectId, Color color, int width = 2 ) : void
objectId int
color Color
width int
Résultat void

ObjectDataSearch() public méthode

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.
Résultat List

Open() public méthode

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.
Résultat void

RefreshData() public méthode

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

SetCenterPoint() public méthode

public SetCenterPoint ( SprPoint3D centerPoint ) : void
centerPoint SprPoint3D
Résultat void

SetCenterPoint() public méthode

public SetCenterPoint ( double east, double north, double elevation ) : void
east double
north double
elevation double
Résultat void

SetEyePoint() public méthode

public SetEyePoint ( SprPoint3D eyePoint ) : void
eyePoint SprPoint3D
Résultat void

SetEyePoint() public méthode

public SetEyePoint ( double east, double north, double elevation ) : void
east double
north double
elevation double
Résultat void

SprApplication() public méthode

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

TakeSnapshot() public méthode

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.
Résultat Image