Interface ICAEDocuments
Gives access to Cae documents.
Namespace: TopSolid.Cae.Kernel.Automating
Assembly: TopSolid.Cae.Kernel.Automating.dll
Syntax
[ServiceContract]
public interface ICAEDocuments
Remarks
This interface is available since v7.17.
Methods
GetMeshTargetSize(DocumentId)
Gets target size of mesh into an analysis preparation document.
Declaration
[OperationContract]
SmartReal GetMeshTargetSize(DocumentId inDocumentId)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the preparation document. |
Returns
Type | Description |
---|---|
SmartReal | The target size of the mesh. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
SmartReal meshSize =TopSolidCaeHost.Documents.GetMeshTargetSize(docId);
IsAnalysisPreparationDocument(DocumentId)
Tells whether a document is an analysis preparation document.
Declaration
[OperationContract]
bool IsAnalysisPreparationDocument(DocumentId inDocumentId)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the document to analyze. |
Returns
Type | Description |
---|---|
System.Boolean | The document is an analysis preparation document. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
string isAnalysisPreparationDocument = TopSolidCaeHost.Documents.IsAnalysisPreparationDocument(docId);
IsAnalysisResultsDocument(DocumentId)
Tells whether a document is an analysis results document.
Declaration
[OperationContract]
bool IsAnalysisResultsDocument(DocumentId inDocumentId)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the document to analyze. |
Returns
Type | Description |
---|---|
System.Boolean | The document is an analysis results document. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
string isAnalysisResultsDocument = TopSolidCaeHost.Documents.IsAnalysisResultsDocument(docId);
MeshNeedsRefreshing(DocumentId)
Tells whether the mesh of an analysis preparation document needs to be refreshed.
Declaration
[OperationContract]
bool MeshNeedsRefreshing(DocumentId inDocumentId)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the document to analyze. |
Returns
Type | Description |
---|---|
System.Boolean | Whether mesh needs to be refreshed. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
string needsRefreshing = TopSolidCaeHost.Documents.MeshNeedsRefreshing(docId);
RefreshMesh(DocumentId)
Refresh the mesh of an analysis preparation document.
Declaration
[OperationContract]
bool RefreshMesh(DocumentId inDocumentId)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the document holding mesh to refresh. |
Returns
Type | Description |
---|---|
System.Boolean | Whether mesh has actually been refreshed. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
if (TopSolidHost.Application.StartModification("refresh mesh", false))
{
try
{
if (TopSolidCaeHost.Documents.MeshNeedsRefreshing(docId))
{
TopSolidCaeHost.Documents.RefreshMesh(docId);
}
TopSolidHost.Application.EndModification(true, true);
}
catch
{
TopSolidHost.Application.EndModification(false, false);
}
}
SetMeshTargetSize(DocumentId, SmartReal)
Sets target size for a mesh of an analysis preparation document.
Declaration
[OperationContract]
bool SetMeshTargetSize(DocumentId inDocumentId, SmartReal inTargetValue)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the preparation document. |
SmartReal | inTargetValue | Target size |
Returns
Type | Description |
---|---|
System.Boolean | Whether mesh size has been changed. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
if (TopSolidHost.Application.StartModification("Change mesh Size", false))
{
try
{
SmartReal newSize = new SmartReal(UnitType.Length, 0.010);
TopSolidCaeHost.Documents.SetMeshTargetSize(docId, newSize);
TopSolidHost.Application.EndModification(true, true);
}
catch
{
TopSolidHost.Application.EndModification(false, false);
}
}
Solve(DocumentId, out String)
Launch resolution of an analysis preparation document.
Declaration
[OperationContract]
bool Solve(DocumentId inDocumentId, out string outMessage)
Parameters
Type | Name | Description |
---|---|---|
DocumentId | inDocumentId | Identifier of the document to solve. |
System.String | outMessage | Message returned by solver, or error message. |
Returns
Type | Description |
---|---|
System.Boolean | Whether mesh has actually been solved. |
Remarks
This method is available since v7.19.
Examples
DocumentId docId = TopSolidHost.Documents.EditedDocument;
if (TopSolidHost.Application.StartModification("Do Solve", false))
{
try
{
TopSolidCaeHost.Documents.Solve(docId, out string message);
TopSolidHost.Application.EndModification(true, true);
}
catch
{
TopSolidHost.Application.EndModification(false, false);
}
}