Class TopSolidHost
Represents TopSolid host providing WCF services for automating.
Inheritance
Inherited Members
Namespace: TopSolid.Kernel.Automating
Assembly: cs.temp.dll.dll
Syntax
[AvailableSinceVersion(7, 6, 0, 0)]
public static class TopSolidHost
Remarks
This class is available since v7.6.
Fields
AngularPrecision
Geometric angular precision (in radians): two lines which make an angle of less than this value are considered parallel.
Declaration
public const double AngularPrecision = 1E-08
Field Value
Type | Description |
---|---|
System.Double |
LinearPrecision
Geometric linear precision (in meters): two points which are less than this distance apart are considered coincident.
Declaration
public const double LinearPrecision = 1E-08
Field Value
Type | Description |
---|---|
System.Double |
Properties
Application
Gets access to the application, or null if not available.
Declaration
public static IApplication Application { get; }
Property Value
Type | Description |
---|---|
IApplication |
Arguments
Gets or sets the arguments to declare to the TopSolid process when the process needs to be started. To set before the call to the Connect() methods.
Declaration
public static string Arguments { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Classifications
Gets access to classifications, or null if not available.
Declaration
public static IClassifications Classifications { get; }
Property Value
Type | Description |
---|---|
IClassifications |
ClientAddress
Gets the client IP address used for receiving events when using TCP, or null for not managing events.
Declaration
public static string ClientAddress { get; }
Property Value
Type | Description |
---|---|
System.String |
ClientName
Gets the client name, or null if anonymous.
Declaration
public static string ClientName { get; }
Property Value
Type | Description |
---|---|
System.String |
ClientPort
Gets the client port used for receiving events when using TCP, or 0 for not managing events.
Declaration
public static int ClientPort { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ClientVersion
Gets the version of TopSolid used to build this application.
Declaration
public static int ClientVersion { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
The value returned is defined by: Major * 100000000 + Minor * 1000000 + Build * 1000 + Revision
.
For example, v7.5.200.100 is returned as: 705200100
.
Documents
Gets access to documents, or null if not available.
Declaration
public static IDocuments Documents { get; }
Property Value
Type | Description |
---|---|
IDocuments |
DocumentsEventsHost
Gets access to the documents events service host, or null if not created.
Declaration
public static ServiceHost DocumentsEventsHost { get; }
Property Value
Type | Description |
---|---|
ServiceHost |
Elements
Gets access to elements, or null if not available.
Declaration
public static IElements Elements { get; }
Property Value
Type | Description |
---|---|
IElements |
Entities
Gets access to entities, or null if not available.
Declaration
public static IEntities Entities { get; }
Property Value
Type | Description |
---|---|
IEntities |
Families
Gets access to families, or null if not available.
Declaration
public static IFamilies Families { get; }
Property Value
Type | Description |
---|---|
IFamilies |
Geometries2D
Gets access to 2D geometric entities, or null if not available.
Declaration
public static IGeometries2D Geometries2D { get; }
Property Value
Type | Description |
---|---|
IGeometries2D |
Geometries3D
Gets access to 3D geometric entities, or null if not available.
Declaration
public static IGeometries3D Geometries3D { get; }
Property Value
Type | Description |
---|---|
IGeometries3D |
HostAddress
Gets the host IP address, or null if not using TCP.
Declaration
public static string HostAddress { get; }
Property Value
Type | Description |
---|---|
System.String |
HostInstance
Gets the host instance.
Declaration
public static TopSolidHostInstance HostInstance { get; }
Property Value
Type | Description |
---|---|
TopSolidHostInstance |
HostPort
Gets the host port, or 0 if not using TCP.
Declaration
public static int HostPort { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsConnected
Tells whether TopSolid is connected.
Declaration
public static bool IsConnected { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Layers
Gets access to layer entities, or null if not available.
Declaration
public static ILayers Layers { get; }
Property Value
Type | Description |
---|---|
ILayers |
Licenses
Gets access to licenses, or null if not available.
Declaration
public static ILicenses Licenses { get; }
Property Value
Type | Description |
---|---|
ILicenses |
Materials
Gets access to materials, or null if not available.
Declaration
public static IMaterials Materials { get; }
Property Value
Type | Description |
---|---|
IMaterials |
Operations
Gets access to operations, or null if not available.
Declaration
public static IOperations Operations { get; }
Property Value
Type | Description |
---|---|
IOperations |
Options
Gets access to documents options, or null if not available.
Declaration
public static IOptions Options { get; }
Property Value
Type | Description |
---|---|
IOptions |
Parameters
Gets access to parameter entities, or null if not available.
Declaration
public static IParameters Parameters { get; }
Property Value
Type | Description |
---|---|
IParameters |
Pdm
Gets access to the PDM, or null if not available.
Declaration
public static IPdm Pdm { get; }
Property Value
Type | Description |
---|---|
IPdm |
PdmAdmin
Gets access to the PDM administration, or null if not available.
Declaration
public static IPdmAdmin PdmAdmin { get; }
Property Value
Type | Description |
---|---|
IPdmAdmin |
PdmSecurity
Gets access to the PDM security, or null if not available.
Declaration
public static IPdmSecurity PdmSecurity { get; }
Property Value
Type | Description |
---|---|
IPdmSecurity |
PdmWorkflow
Gets access to the PDM administration, or null if not available.
Declaration
public static IPdmWorkflow PdmWorkflow { get; }
Property Value
Type | Description |
---|---|
IPdmWorkflow |
PipeName
Gets or sets the name used to make named pipe, or null for default.
Declaration
public static string PipeName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property can be changed before connecting to a TopSolid host on the same machine using named pipes if the default name is not convenient (in particular when several TopSolid processes are running at the same time), it is not needed to change it otherwise.
This property cannot be set once connected to TopSolid, i.e. when IsConnected is true
.
Shapes
Gets access to shape entities, or null if not available.
Declaration
public static IShapes Shapes { get; }
Property Value
Type | Description |
---|---|
IShapes |
Sketches2D
Gets access to 2D sketches, or null if not available.
Declaration
public static ISketches2D Sketches2D { get; }
Property Value
Type | Description |
---|---|
ISketches2D |
Sketches3D
Gets access to 3D sketches, or null if not available.
Declaration
public static ISketches3D Sketches3D { get; }
Property Value
Type | Description |
---|---|
ISketches3D |
Textures
Gets access to textures, or null if not available.
Declaration
public static ITextures Textures { get; }
Property Value
Type | Description |
---|---|
ITextures |
Units
Gets access to units, or null if not available.
Declaration
public static IUnits Units { get; }
Property Value
Type | Description |
---|---|
IUnits |
User
Gets access to the user, or null if not available.
Declaration
public static IUser User { get; }
Property Value
Type | Description |
---|---|
IUser |
Version
Gets the version of TopSolid host, or 0 if not connected.
Declaration
public static int Version { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
The value returned is defined by: Major * 100000000 + Minor * 1000000 + Build * 1000 + Revision
.
For example, v7.5.200.100 is returned as: 705200100
.
Visualization3D
Gets access to 3D visualization, or null if not available.
Declaration
public static IVisualization3D Visualization3D { get; }
Property Value
Type | Description |
---|---|
IVisualization3D |
Methods
Connect()
Connects to TopSolid application.
Declaration
public static bool Connect()
Returns
Type | Description |
---|---|
System.Boolean | TopSolid has been automatically started. |
Remarks
TopSolid is automatically started if it is not already running.
When starting TopSolid automatically, if several versions are installed, the most recent version is started.
When starting TopSolid automatically, if both 64-bit and 32-bit versions are installed, the 64-bit version is started.
This methods waits up to 10 minutes for TopSolid to be ready before failing to connect.
Connect(Boolean, Int32)
Connects to TopSolid application.
Declaration
public static bool Connect(bool inStarts, int inTimeOut)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | inStarts | Automatically starts TopSolid if it is not already running. |
System.Int32 | inTimeOut | Number of seconds to wait for TopSolid to be ready before failing to connect. |
Returns
Type | Description |
---|---|
System.Boolean | TopSolid has been automatically started. |
Remarks
When starting TopSolid automatically, if several versions are installed, the most recent version is started.
When starting TopSolid automatically, if both 64-bit and 32-bit versions are installed, the 64-bit version is started.
Connect(Boolean, Int32, String)
Connects to TopSolid application.
Declaration
public static bool Connect(bool inStarts, int inTimeOut, string inClientName)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | inStarts | Automatically starts TopSolid if it is not already running. |
System.Int32 | inTimeOut | Number of seconds to wait for TopSolid to be ready before failing to connect. |
System.String | inClientName | Name identifying your application, ex: "MyApplication". |
Returns
Type | Description |
---|---|
System.Boolean | TopSolid has been automatically started. |
Remarks
When starting TopSolid automatically, if several versions are installed, the most recent version is started.
When starting TopSolid automatically, if both 64-bit and 32-bit versions are installed, the 64-bit version is started.
The inClientName
string must uniquely identify your application, as it is used to make a Windows pipe name that must be unique
when managing events.
Connect(String)
Connects to TopSolid application.
Declaration
public static bool Connect(string inClientName)
Parameters
Type | Name | Description |
---|---|---|
System.String | inClientName | Name identifying your application, ex: "MyApplication". |
Returns
Type | Description |
---|---|
System.Boolean | TopSolid has been automatically started. |
Remarks
TopSolid is automatically started if it is not already running.
When starting TopSolid automatically, if several versions are installed, the most recent version is started.
When starting TopSolid automatically, if both 64-bit and 32-bit versions are installed, the 64-bit version is started.
This methods waits up to 10 minutes for TopSolid to be ready before failing to connect.
DefineConnection(String, Int32, String, Int32)
Defines the connection between this client application and TopSolid host for remote access.
Declaration
public static void DefineConnection(string inHostAddress, int inHostPort, string inClientAddress, int inClientPort)
Parameters
Type | Name | Description |
---|---|---|
System.String | inHostAddress | Host IP address (or "localhost" for local machine) if using TCP, or null otherwise (default). |
System.Int32 | inHostPort | Host port used if using TCP, or 0 otherwise (default). |
System.String | inClientAddress | Client IP address (or "localhost" for local machine) if using TCP and managing events, or null otherwise (default). |
System.Int32 | inClientPort | Client port used if using TCP and managing events, or 0 otherwise (default). |
Remarks
This method must be called before connecting to a remote TopSolid host on another machine to use TCP instead of named pipes, it is not needed to call it otherwise.
When performing remote access and using events, inClientAddress
and inClientPort
must be set to allow TopSolid to connect
to this client application, otherwise they must be set to null
and 0
.
This method cannot be called once connected to TopSolid, i.e. when IsConnected is true
.
Disconnect()
Disconnects from TopSolid application.
Declaration
public static void Disconnect()
HandleDocumentsEvents(Type)
Starts documents events handling.
Declaration
public static void HandleDocumentsEvents(Type inClassType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | inClassType | Type of class implementing IDocumentsEvents interface. |
Remarks
To handle documents events, one needs to make a class implementing IDocumentsEvents interface, and call this method
with that type in the inClassType
argument.
This method creates a new service host, returned afterwards by the DocumentsEventsHost property.
This method then subscribes to documents events using the SubscribeToEvents(Int32, String) method.
This method may only be called when connected to TopSolid, otherwise an exception is thrown.
ParseVersion(String)
Parses a string version (i.e. "7.8.200.0" to get the corresponding integer version (i.e. 708200000).
Declaration
public static int ParseVersion(string inVersion)
Parameters
Type | Name | Description |
---|---|---|
System.String | inVersion | String version. |
Returns
Type | Description |
---|---|
System.Int32 | Integer version. |
Events
Exited
This event is raised when the host process was running on the local machine and has exited.
Declaration
public static event EventHandler Exited
Event Type
Type | Description |
---|---|
System.EventHandler |