ActiveField Technology Objects Overview Hierarchy Chart How to Start: Application Object How to work with Problems How to work with Model How to work with Data How to Analyze Results

Export Method

Summary

Exports the calculation results to an ASCII or binary table file.

Syntax

Object.Export (
   settings As ExportSettings )
Result.Export (
   settings As ExportSettings,
  [quantities As FieldQuantities] )

Parameters

settings
[in, optional] ExportSettings
quantities
[in, optional] FieldQuantities

Remarks

Two objects - Model and Result have the Export method.

Model object

The settings parameter of ExportSettings type features following properties:

  1. The FilePath property sets the export file name.

  2. The ExportMode property (of QfExportMode type) defines the output format.
    qfModeMesh = 1 defines finite element mesh output of the model to a text file;
    qfModeDXF = 2 defines output of the geometric model (without mesh) to a DXF file for data exchange with CAD programs like AutoCAD®.

To adjust export settings it is needed to get the ExportSettings object using similarly named ExportSettings property of the Model object.

 Set prb = QF.ActiveProblem
prb.LoadModel
Set mdl = prb.Model

Set expSet = mdl.ExportSettings
expSet.ExportMode = qfModeMesh
expSet.FilePath = "Magn1_ExportedMesh.txt"
mdl.Export expSet
 

Result object

The settings parameter of ExportSettings type features following properties:

  1. The FilePath property sets the export file name.

  2. The ExportMode property (of QfExportMode type) defines the output format.
    qfModeGrid = 0 defines the field results output in the nodes of the rectangular grid with constant step;
    qfModeMesh = 1 defines the field results output in every finite element of the model;
  3. The ExportMode property

To adjust export settings it is needed to get the ExportSettings object using similarly named ExportSettings property of the Result object.

The optional quantities parameter of FieldQuantities collection type may inlude the lists of desired local physical quantities to export.

 If Not prb.Solved Then prb.SolveProblem
    prb.AnalyzeResults
Set res = prb.Result
Set expSet = res.ExportSettings
With expSet
    .FilePath = "_Exported_Grid.txt"
    .ExportMode = qfModeGrid
    .StepX = 1
    .StepY = 0.5
End With

Set qList = res.LocalFieldQuantities
qList.Clear
qList.Add (qfPotential)
qList.Add (qfGrad)
qList.Add (qfKGradX)
qList.Add (qfKGradY)

res.Export expSet, qList
 

In this example, we first get the ExportSettings object using the same name property of the Results object. Then we configure ExportSettings object parameters: ExportMode, output file name, and rectangular grid steps. Then we get a collection of physical quantities qList using the LocalFieldQuantities property. Collection contains all the field values ??that can be calculated. We remove all items from collection ??(Clear method) and then add the ones we need: qfPotential, qfGrad, qfKGradX and qfKGradY.
Now all the necessary settings are made, and we can call the Export method with two parameters.