SharpPlant is a .NET wrapper for Intergraph SmartPlant® products, written in C#. It was designed to simplify .NET development, as well as provide additional API functionality as needed. The initial release of this API covers SmartPlant® Review only. However as time, resources and community involvement picks up, the roadmap is planned to expand into further Intergraph products. You can view more about the Intergraph SmartPlant® product line at http://www.intergraph.com
- Download the latest SharpPlant project zip and build the dll in Visual Studio, or your preferred .NET IDE.
- Add the SharpPlant.dll as a reference to a new or existing .NET solution to make the classes/methods available.
- SharpPlant requires .NET 4.0 or higher as it implements dynamic variables at runtime.
// Create a new application object
var sprApp = new SprApplication();
// Update the application text window
sprApp.TextWindow_Update("SharpPlant loaded successfully");
// Create a new tag object
var newTag = new SprTag();
// Set the tag properties
newTag.Text = "High-point vent required as per P&ID";
newTag.Discipline = "Piping";
newTag.Creator = "ExampleUser";
// Place the tag in the active application
sprApp.Tags_Place(ref newTag);
// Create a new annotation object
var newAnno = new SprAnnotation();
// Set the annotation properties
newAnno.Text = "Removable handrail";
newAnno.DisplayBackground = true;
newAnno.DisplayLeader = true;
newAnno.BackgroundColor = System.Drawing.Color.Green;
newAnno.Persistent = true;
// Place the annotation in the active application
sprApp.Annotations_Place(ref newAnno);
// Create a new snapshot object
var newSnap = new SprSnapShot();
// Set the snapshot properties
newSnap.AntiAlias = 3;
newSnap.OutputFormat = SprSnapshotFormat.Png;
newSnap.Overwrite = true;
// Take the snapshot
sprApp.TakeSnapshot(newSnap, "TestImage", @"C:\TestSnapshots\");
// Prompt a user to select an object in the active application instance
var newObjectData = sprApp.GetObjectData("Select an object to view");
- DrAPI: SprApplication
- DrAnnotationDbl: SprAnnotation
- DrDisplaySetDbl: NOT WRAPPED
- DrKey: SprLinkage
- DrLongArray: OBSOLETE
- DrMask: NOT WRAPPED
- DrMeasurement: NOT WRAPPED
- DrMeasurementCollection: NOT WRAPPED
- DrObjectDataDbl: SprObject
- DrPointDbl: SprPoint
- DrSnapShot: SprSnapShot
- DrStringArray: OBSOLETE
- DrTransform: NOT WRAPPED
- DrViewDbl: NOT WRAPPED
- DrVolumeAnnotation: NOT WRAPPED
- DrWindow: SprWindow
SharpPlant does not require the VaxCtrl3.dll to be added as a project reference, however it needs to be registered on any machine it runs on (installing SmartPlant® Review does this automatically).
Additional resources for SmartPlant® Review development can be found in the ..\resdlls\0009 directory inside the local install folder:
- DRAPI_API.cmh
- Drapix_API.chm
If the API module is installed, additional libraries and files will be located in the ..\Api directory inside the local install folder:
- DRAPI.H
- drapi32.dll
- drapi32.lib
- 4/8/2013 Initial release
- 8/12/2013 Beta 0.4 Release
[Parrish Husband] (https://github.com/phusband)
[Official support thread at DaveTyner.com] (http://www.davetyner.com/forum/forumdisplay.php?127-Sharp-Plant)
SharpPlant is available under the MIT license. See the LICENSE file for more info.