Interface IApplication
Gives access to the application.
Namespace: TopSolid.Kernel.Automating
Assembly: cs.temp.dll.dll
Syntax
[AvailableSinceVersion(7, 6, 0, 0)]
public interface IApplication
Remarks
This interface is available since v7.6.
Properties
ActiveCommandFullName
Gets the full name of the active command (i.e. "TopSolid.Kernel.UI.D3.Shapes.Creations.BlockCommand").
Declaration
[AvailableSinceVersion(7, 12, 0, 0)]
string ActiveCommandFullName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
If there is no active command, null is returned.
This property is available since v7.12.
ActiveCommandName
Gets the localized name of the active command, as it appears to the user in the menu.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
string ActiveCommandName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
If there is no active command, null is returned.
This property is available since v7.6.
CurrentPaperFormat
Gets or sets the name of the current paper format.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
string CurrentPaperFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
This property is available since v7.6.
CurrentPaperSource
Gets or sets the name of the current paper source.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
string CurrentPaperSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
This property is available since v7.6.
CurrentPrinterName
Gets or sets the name of the current printer.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
string CurrentPrinterName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
This property is available since v7.6.
CurrentUICultureName
Gets the name of the current UI culture of the application.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
string CurrentUICultureName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
The culture name is in the format "[languagecode2]-[country/regioncode2]", where [languagecode2] is a lowercase two-letter code derived from ISO 639-1 and [country/regioncode2] is an uppercase two-letter code derived from ISO 3166.
This property is available since v7.7.
Examples
"en-US" for English (United States), "fr-FR" for French (France), "fr-BE" for French (Belgium), ...
ExporterCount
Gets the number of available document exporters.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
int ExporterCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
This property is available since v7.6.
ImporterCount
Gets the number of available document importers.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
int ImporterCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
This property is available since v7.6.
IsWindowMaximized
Tells whether the application window is maximized.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
bool IsWindowMaximized { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This property is available since v7.7.
IsWindowMinimized
Tells whether the application window is minimized.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
bool IsWindowMinimized { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This property is available since v7.7.
PaperFormats
Gets the names of the available paper formats for the current printer.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
List<string> PaperFormats { get; }
Property Value
| Type | Description |
|---|---|
| List<System.String> |
Remarks
This property is available since v7.6.
PaperSources
Gets the names of the available paper sources for the current printer.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
List<string> PaperSources { get; }
Property Value
| Type | Description |
|---|---|
| List<System.String> |
Remarks
This property is available since v7.6.
PrinterNames
Gets the names of the available printers.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
List<string> PrinterNames { get; }
Property Value
| Type | Description |
|---|---|
| List<System.String> |
Remarks
This property is available since v7.6.
ProcessId
Gets the identifier of application process.
Declaration
[AvailableSinceVersion(7, 10, 0, 0)]
int ProcessId { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Version
Gets the version of the application.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
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.
This method returns 0 if the application has just been started and is not ready yet.
This property is available since v7.6.
Methods
BringToFrontWindow()
Brings the application window to the front.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
void BringToFrontWindow()
Remarks
This method is available since v7.7.
EndJournaling()
Ends journaling.
Declaration
[AvailableSinceVersion(7, 8, 0, 0)]
void EndJournaling()
Remarks
This method is available since v7.8.
EndModification(Boolean, Boolean)
Ends performing modifications.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
void EndModification(bool inIsOk, bool inUpdates)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | inIsOk | Whether the modifications have been successful. |
| System.Boolean | inUpdates | Whether to perform an update. |
Remarks
This method must be called after the StartModification(String, Boolean) method has been called and has returned true.
If the modifications have not been successful, they are undone when possible.
This method is available since v7.6.
Examples
if (TopSolidHost.Application.StartModification("My Modification", false))
{
try
{
// Perform my modification.
TopSolidHost.Application.EndModification(true, true);
}
catch
{
TopSolidHost.Application.EndModification(false, false);
}
}
GetCurrentPrinterConfiguration(out Real, out Real, out Real, out Real, out Real, out Real, out Real, out Real, out Real, out Real, out Real)
Gets the current printer configuration.
Declaration
[AvailableSinceVersion(7, 13, 0, 0)]
void GetCurrentPrinterConfiguration(out Real outLeftMargin, out Real outRightMargin, out Real outTopMargin, out Real outBottomMargin, out Real outHorizontalOffset, out Real outVerticalOffset, out Real outThinLineWidth, out Real outMediumThinLineWidth, out Real outMediumLineWidth, out Real outThickLineWidth, out Real outExtraThickLineWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| Real | outLeftMargin | The left margin. |
| Real | outRightMargin | The right margin. |
| Real | outTopMargin | The top margin. |
| Real | outBottomMargin | The bottom margin. |
| Real | outHorizontalOffset | The horizontal offset. |
| Real | outVerticalOffset | The vertical offset. |
| Real | outThinLineWidth | Width of the thin line. |
| Real | outMediumThinLineWidth | Width of the medium thin line. |
| Real | outMediumLineWidth | Width of the medium line. |
| Real | outThickLineWidth | Width of the thick line. |
| Real | outExtraThickLineWidth | Width of the extra thick line. |
Remarks
This method is available since v7.13.
GetExporterFileType(Int32, out String, out String[])
Gets the type of files managed by an exporter.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
void GetExporterFileType(int inExporterIx, out string outFileTypeName, out string[] outFileExtensions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inExporterIx | Index of exporter to analyze, within [0, ExporterCount-1]. |
| System.String | outFileTypeName | Name of the type of the managed files (ex: "Parasolid", for Parasolid files). |
| System.String[] | outFileExtensions | Extensions of the managed files, with the leading '.' character (ex: { ".x_t", ".xmt_txt", ".x_b", ".xmt_bin" } for Parasolid files). |
Remarks
This method is available since v7.6.
GetExporterOptions(Int32)
Gets the options of an exporter.
Declaration
[AvailableSinceVersion(7, 8, 0, 0)]
List<KeyValue> GetExporterOptions(int inExporterIx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inExporterIx | Index of exporter to analyze, within [0, ExporterCount-1]. |
Returns
| Type | Description |
|---|---|
| List<KeyValue> | Exporter options. |
Remarks
This method is available since v7.8.
GetImporterFileType(Int32, out String, out String[])
Gets the type of files managed by an importer.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
void GetImporterFileType(int inImporterIx, out string outFileTypeName, out string[] outFileExtensions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inImporterIx | Index of importer to analyze, within [0, ImporterCount-1]. |
| System.String | outFileTypeName | Name of the type of the managed files (ex: "Parasolid", for Parasolid files). |
| System.String[] | outFileExtensions | Extensions of the managed files, with the leading '.' character (ex: { ".x_t", ".xmt_txt", ".x_b", ".xmt_bin" } for Parasolid files). |
Remarks
This method is available since v7.6.
GetImporterOptions(Int32)
Gets the options of an importer.
Declaration
[AvailableSinceVersion(7, 8, 0, 0)]
List<KeyValue> GetImporterOptions(int inImporterIx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inImporterIx | Index of importer to analyze, within [0, ImporterCount-1]. |
Returns
| Type | Description |
|---|---|
| List<KeyValue> | Importer options. |
Remarks
This method is available since v7.8.
GetMachineIds(out String, out String)
Gets the machine identifiers that may be used for fixed licenses.
Declaration
[AvailableSinceVersion(7, 11, 0, 0)]
void GetMachineIds(out string outProtectionKeyId, out string outNetworkAdaptersId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | outProtectionKeyId | Identifier based on protection key, or empty string if none detected. |
| System.String | outNetworkAdaptersId | Identifier based on main network adapters, or empty string if none detected. |
Remarks
This method is available since v7.11.
InvokeCommand(String)
Invokes a specified menu command.
Declaration
[AvailableSinceVersion(7, 12, 0, 0)]
bool InvokeCommand(string inFullName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inFullName | Full name of the command to invoke (i.e. "TopSolid.Kernel.UI.D3.Shapes.Creations.BlockCommand"). |
Returns
| Type | Description |
|---|---|
| System.Boolean | The command has been found and invoked. |
Remarks
This method is available since v7.12.
IsExporterValid(Int32)
Tells whether a valid license is available for an exporter.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
bool IsExporterValid(int inExporterIx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inExporterIx | Index of exporter to analyze, within [0, ExporterCount-1]. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether a valid license is available for the exporter. |
Remarks
This method is available since v7.6.
IsImporterValid(Int32)
Tells whether a valid license is available for an importer.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
bool IsImporterValid(int inImporterIx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inImporterIx | Index of importer to analyze, within [0, ImporterCount-1]. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether a valid license is available for the importer. |
Remarks
This method is available since v7.6.
IsLicenseValid(Int32)
Tells whether a valid TopSolid license is available.
Declaration
[AvailableSinceVersion(7, 8, 303, 100)]
bool IsLicenseValid(int inModuleId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | inModuleId | TopSolid module identifier. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This method is available since v7.8.303.100.
IsProviderLicenseValid(String, String, Int32, Int32, Int32)
Tells whether a valid license is available from a specified provider.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
bool IsProviderLicenseValid(string inProvider, string inPublicKey, int inVersionMajor, int inVersionMinor, int inModuleId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inProvider | License provider name. |
| System.String | inPublicKey | License public key. |
| System.Int32 | inVersionMajor | Version major number within [0,20]. |
| System.Int32 | inVersionMinor | Version minor number within [0,99]. |
| System.Int32 | inModuleId | Module identifier. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This method is available since v7.7.
MaximizeWindow()
Maximizes the application window.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
void MaximizeWindow()
Remarks
This method is available since v7.7.
MinimizeWindow()
Minimizes the application window.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
void MinimizeWindow()
Remarks
This method is available since v7.7.
Quit(Boolean, Boolean)
Terminates the applicaton.
Declaration
[AvailableSinceVersion(7, 7, 201, 160)]
void Quit(bool inAsksUser, bool inSaves)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | inAsksUser | Whether to ask the user for confirmation if some documents need to be saved. |
| System.Boolean | inSaves | Whether to automatically save the documents that need it when the user is not asked for confirmation. |
Remarks
This method is available since v7.7.201.160.
RestoreWindow()
Restores the application window that has been minimized or maximized.
Declaration
[AvailableSinceVersion(7, 7, 0, 0)]
void RestoreWindow()
Remarks
This method is available since v7.7.
SearchEnumerationLocalizedText(EnumerationProperty)
Searches for the localized text corresponding to a specified enumeration property.
Declaration
[AvailableSinceVersion(7, 12, 0, 0)]
string SearchEnumerationLocalizedText(EnumerationProperty inProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| EnumerationProperty | inProperty | Property to analyze. |
Returns
| Type | Description |
|---|---|
| System.String | Corresponding localized text, or |
Remarks
This method is available since v7.12.
SetCurrentPrinterConfiguration(Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>, Nullable<Real>)
Sets the current printer configuration.
Declaration
[AvailableSinceVersion(7, 13, 0, 0)]
void SetCurrentPrinterConfiguration(Real? inLeftMargin, Real? inRightMargin, Real? inTopMargin, Real? inBottomMargin, Real? inHorizontalOffset, Real? inVerticalOffset, Real? inThinLineWidth, Real? inMediumThinLineWidth, Real? inMediumLineWidth, Real? inThickLineWidth, Real? inExtraThickLineWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<Real> | inLeftMargin | The left margin. |
| System.Nullable<Real> | inRightMargin | The right margin. |
| System.Nullable<Real> | inTopMargin | The top margin. |
| System.Nullable<Real> | inBottomMargin | The bottom margin. |
| System.Nullable<Real> | inHorizontalOffset | The horizontal offset. |
| System.Nullable<Real> | inVerticalOffset | The vertical offset. |
| System.Nullable<Real> | inThinLineWidth | Width of the thin line. |
| System.Nullable<Real> | inMediumThinLineWidth | Width of the medium thin line. |
| System.Nullable<Real> | inMediumLineWidth | Width of the medium line. |
| System.Nullable<Real> | inThickLineWidth | Width of the thick line. |
| System.Nullable<Real> | inExtraThickLineWidth | Width of the extra thick line. |
Remarks
This method is available since v7.13.
SetJournalingMethodCall(Boolean, Boolean, Boolean)
Sets the format of the journaling of method calls.
Declaration
[AvailableSinceVersion(7, 8, 0, 0)]
void SetJournalingMethodCall(bool inWritesHost, bool inWritesHostMember, bool inWritesArgumentName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | inWritesHost | Whether to write the name of the host. |
| System.Boolean | inWritesHostMember | Whether to write the name of the host member. |
| System.Boolean | inWritesArgumentName | Whether to write the name of the argument. |
Remarks
The format of a method call is: [Host Name].[Host Member Name].[Method Name]([Argument Name] = value, ...).
Example: TopSolidHost.Documents.SetName(inDocumentId = ..., inName = ...).
This method is available since v7.8.
SetSilentMode(Boolean)
Sets the silent mode.
Declaration
[AvailableSinceVersion(7, 15, 400, 100)]
void SetSilentMode(bool inIsSilent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | inIsSilent | Tells wether the silent mode is activated. |
Remarks
This method is available since v7.15.
StartJournaling(String)
Starts journaling.
Declaration
[AvailableSinceVersion(7, 8, 0, 0)]
void StartJournaling(string inFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inFilePath | Full path of the journal file to create without its ".TopAJ" suffix. |
Remarks
TopSolid can record every call to Automation performing an action in an external file called the journal file.
This is a record of each Automation method called, with the arguments supplied to and results returned from those methods.
This helps to debug applications that use Automation. The journal is text-based, to make it easy to examine in order to find out where problems are caused.
This method is available since v7.8.
StartModification(String, Boolean)
Starts performing modifications.
Declaration
[AvailableSinceVersion(7, 6, 0, 0)]
bool StartModification(string inUndoSequenceName, bool inIsUndoSequenceGhost)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inUndoSequenceName | Name of the undo sequence. |
| System.Boolean | inIsUndoSequenceGhost | Whether the undo sequence is hidden from the user. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Modifications can be performed. |
Remarks
This method must be called before any modification is attempted.
This method is available since v7.6.
Examples
if (TopSolidHost.Application.StartModification("My Modification", false))
{
try
{
// Perform my modification.
TopSolidHost.Application.EndModification(true, true);
}
catch
{
TopSolidHost.Application.EndModification(false, false);
}
}