Table of Contents

Class FemDesignConnection

Namespace
FemDesign
Assembly
FemDesign.Core.dll

FEM-Design real-time connection. Use this to open a Model, run Analysis, Design, extract results and more.

public class FemDesignConnection : IDisposable
Inheritance
FemDesignConnection
Implements
Inherited Members
Extension Methods

Constructors

FemDesignConnection(string, bool, bool, string, bool, Verbosity)

Open a new instance of FEM-Design and connect to it.

public FemDesignConnection(string fdInstallationDir = "C:\\Program Files\\StruSoft\\FEM-Design 24\\", bool minimized = false, bool keepOpen = false, string outputDir = null, bool tempOutputDir = false, Verbosity verbosity = Verbosity.ScriptLogLinesOnly)

Parameters

fdInstallationDir string

FEM-Design software installation directory.

minimized bool

Open FEM-Design as a minimized window.

keepOpen bool

If true FEM-Design will be left open and have to be manually exited.

outputDir string

The directory to save script files. If set to null, the files will be will be written to a temporary directory and deleted after.

tempOutputDir bool
BE CAREFUL!
If true the outputDir will be deleted on exit. This option has no effect unless outputDir has been specified.
verbosity Verbosity

Fields

DefaultVerbosity

public const Verbosity DefaultVerbosity = ScriptLogLinesOnly

Field Value

Verbosity

Properties

HasExited

public bool HasExited { get; }

Property Value

bool

IsConnected

public bool IsConnected { get; }

Property Value

bool

IsDisconnected

public bool IsDisconnected { get; }

Property Value

bool

OnOutput

Occurs whenever FEM-Design writes a new log message.

Verbosity may be adjusted using SetVerbosity(Verbosity)

public FemDesignConnection.OnOutputEvent OnOutput { get; set; }

Property Value

FemDesignConnection.OnOutputEvent

OutputDir

public string OutputDir { get; set; }

Property Value

string

Verbosity

public Verbosity Verbosity { get; }

Property Value

Verbosity

Methods

ApplyDesignChanges()

public void ApplyDesignChanges()

ApplyDocumentationTemplate(string)

Apply a template to a documentation

public void ApplyDocumentationTemplate(string templatePath)

Parameters

templatePath string

CreateResultPoint(List<CmdResultPoint>)

Create a list of result points.

public void CreateResultPoint(List<CmdResultPoint> resultPoints)

Parameters

resultPoints List<CmdResultPoint>

Disconnect()

Disconnects the current connection. FEM-Design will be left open for normal usage.

public void Disconnect()

Dispose()

public void Dispose()

EndSession()

public void EndSession()

GenerateFeaModel()

public void GenerateFeaModel()

GetFeaBars(Length)

Retrieve line element data from the finite element mesh.

public List<FemBar> GetFeaBars(Length length = Length.m)

Parameters

length Length

Unit of length measurement. Default is meter.

Returns

List<FemBar>

GetFeaLineConnections()

Retrieve the line connection element data from the finite element model.

public List<LineConnectionElement> GetFeaLineConnections()

Returns

List<LineConnectionElement>

GetFeaLineSupports()

Retrieve the line support element data from the finite element model.

public List<LineSupportElement> GetFeaLineSupports()

Returns

List<LineSupportElement>

GetFeaModel(Length)

Retrieve finite element data.

public FiniteElement GetFeaModel(Length units = Length.m)

Parameters

units Length

Unit of length measurement. Default is meter.

Returns

FiniteElement

GetFeaNodes(Length)

Retrieve node geometry data from the finite element mesh.

public List<FemNode> GetFeaNodes(Length length = Length.m)

Parameters

length Length

Unit of length measurement. Default is meter.

Returns

List<FemNode>

GetFeaPointConnections()

Retrieve the point connection element data from the finite element model.

public List<PointConnectionElement> GetFeaPointConnections()

Returns

List<PointConnectionElement>

GetFeaPointSupports()

Retrieve the point support element data from the finite element model.

public List<PointSupportElement> GetFeaPointSupports()

Returns

List<PointSupportElement>

GetFeaShells(Length)

Retrieve surface element data from the finite element mesh.

public List<FemShell> GetFeaShells(Length length = Length.m)

Parameters

length Length

Unit of length measurement. Default is meter.

Returns

List<FemShell>

GetLoadCaseResults<T>(List<string>, IStructureElement, UnitResults, Options)

Retreive load case results from the opened model.

public List<T> GetLoadCaseResults<T>(List<string> loadCases, IStructureElement element = null, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCases List<string>

Load case names for which the results should be return.

element IStructureElement

Optional. Structural element for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

GetLoadCaseResults<T>(List<string>, List<IStructureElement>, UnitResults, Options)

Retreive load case results from the opened model.

public List<T> GetLoadCaseResults<T>(List<string> loadCases, List<IStructureElement> elements, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCases List<string>

Load case names for which the results should be return.

elements List<IStructureElement>

Structural elements for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

GetLoadCaseResults<T>(string, IStructureElement, UnitResults, Options)

Retreive load case results from the opened model.

public List<T> GetLoadCaseResults<T>(string loadCase = null, IStructureElement element = null, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCase string

Optional. Load case name for which the results should be return.

element IStructureElement

Optional. Structural element for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

GetLoadCaseResults<T>(string, List<IStructureElement>, UnitResults, Options)

Retreive load case results from the opened model.

public List<T> GetLoadCaseResults<T>(string loadCase, List<IStructureElement> elements, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCase string

Load case name for which the results should be return.

elements List<IStructureElement>

Structural elements for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

GetLoadCombinationResults<T>(List<string>, IStructureElement, UnitResults, Options)

Retreive load combination results from the opened model.

public List<T> GetLoadCombinationResults<T>(List<string> loadCombinations, IStructureElement element = null, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCombinations List<string>

Load combination names for which the results should be return.

element IStructureElement

Optional. Structural element for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

Exceptions

ArgumentException

GetLoadCombinationResults<T>(List<string>, List<IStructureElement>, UnitResults, Options)

Retreive load combination results from the opened model.

public List<T> GetLoadCombinationResults<T>(List<string> loadCombinations, List<IStructureElement> elements, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCombinations List<string>

Load combination names for which the results should be return.

elements List<IStructureElement>

Structural elements for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

Exceptions

ArgumentException

GetLoadCombinationResults<T>(string, IStructureElement, UnitResults, Options)

Retreive load combination results from the opened model.

public List<T> GetLoadCombinationResults<T>(string loadCombination = null, IStructureElement element = null, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCombination string

Optional. Load combination name for which the results should be return.

element IStructureElement

Optional. Structural element for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

Exceptions

ArgumentException

GetLoadCombinationResults<T>(string, List<IStructureElement>, UnitResults, Options)

Retreive load combination results from the opened model.

public List<T> GetLoadCombinationResults<T>(string loadCombination, List<IStructureElement> elements, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCombination string

Load combination name for which the results should be return.

elements List<IStructureElement>

Structural elements for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

Exceptions

ArgumentException

GetLoadCombinations()

Retrieves the load combinations from the currently opened model/> object.

public Dictionary<int, LoadCombination> GetLoadCombinations()

Returns

Dictionary<int, LoadCombination>

GetLoads()

Retrieves the loads from the currently opened model with all available elements as a Loads object.

public Loads GetLoads()

Returns

Loads

GetModel()

Retrieves the currently opened model with all available elements as a Model object.

public Model GetModel()

Returns

Model

GetQuantities<T>(UnitResults)

Retreive all of the quantity estimation results from the opened model.

public List<T> GetQuantities<T>(UnitResults units = null) where T : IQuantityEstimationResult

Parameters

units UnitResults

Optional. Unit setting for the results.

Returns

List<T>

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

GetResultsFromBsc(string, string, List<IStructureElement>)

Retrieve results using a batch (.bsc) file.

public List<string> GetResultsFromBsc(string inputBscPath, string outputCsvPath = null, List<IStructureElement> element = null)

Parameters

inputBscPath string
outputCsvPath string
element List<IStructureElement>

Returns

List<string>

Exceptions

Exception

GetResultsOnPoints<T>(ResultPoint, UnitResults)

public List<T> GetResultsOnPoints<T>(ResultPoint resultPoint, UnitResults units = null) where T : IResult

Parameters

resultPoint ResultPoint
units UnitResults

Returns

List<T>

Type Parameters

T

GetResultsOnPoints<T>(List<ResultPoint>, UnitResults)

public List<T> GetResultsOnPoints<T>(List<ResultPoint> resultPoints, UnitResults units = null) where T : IResult

Parameters

resultPoints List<ResultPoint>
units UnitResults

Returns

List<T>

Type Parameters

T

GetResults<T>(UnitResults, Options, List<IStructureElement>)

Retreive all of the results from the opened model.

public List<T> GetResults<T>(UnitResults units = null, Options options = null, List<IStructureElement> elements = null) where T : IResult

Parameters

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

elements List<IStructureElement>

Optional. Structural elements for which the results should be return.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

GetStabilityResults<T>(string, int?, UnitResults, Options)

Retreive the stability results from the opened model.

public List<T> GetStabilityResults<T>(string loadCombination = null, int? shapeId = null, UnitResults units = null, Options options = null) where T : IResult

Parameters

loadCombination string

Optional. Load combination name for which the results should be return.

shapeId int?

Optional. Shape identifier for which the results should be return.

units UnitResults

Optional. Unit setting for the results.

options Options

Optional. Options to set up the output location.

Returns

List<T>

List of results of type T if any could be retrieved. If the model has no results of type T or cannot access them at the moment, then the list will be empty.

Type Parameters

T

Result type to retrieve. Must be a type that implements the IResult interface

KeepOpen()

FEM-Design will be left open, when the FemDesignConnection is disposed.

public void KeepOpen()

LoadGroupToLoadComb(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool)

public void LoadGroupToLoadComb(bool fu = true, bool fua = true, bool fus = true, bool fsq = true, bool fsf = true, bool fsc = true, bool fSeisSigned = true, bool fSeisTorsion = true, bool fSeisZdir = true, bool fSkipMinDL = true, bool fForceTemp = true, bool fShortName = true)

Parameters

fu bool
fua bool
fus bool
fsq bool
fsf bool
fsc bool
fSeisSigned bool
fSeisTorsion bool
fSeisZdir bool
fSkipMinDL bool
fForceTemp bool
fShortName bool

Open(Model, bool)

Open a Model in FEM-Design application.

public void Open(Model model, bool disconnect = false)

Parameters

model Model

Model to be opened.

disconnect bool

Set to True to disconnect to the pipe and leave FEM-Design Open.

Open(string, bool)

Open a file in FEM-Design application.

public void Open(string filePath, bool disconnect = false)

Parameters

filePath string

The model file to be opened. Typically a .str or .struxml file, but any filetype supported in FEM-Design is valid.

disconnect bool

Set to True to disconnect to the pipe and leave FEM-Design Open.

OpenAsync(Model)

Open a Model in FEM-Design application.

public Task OpenAsync(Model model)

Parameters

model Model

Model to be opened.

Returns

Task

OpenAsync(string)

Open a file in FEM-Design application.

public Task OpenAsync(string filePath)

Parameters

filePath string

The model file to be opened. Typically a .str or .struxml file, but any filetype supported in FEM-Design is valid.

Returns

Task

RunAnalysis(Analysis)

Runs an analysis task on the current model in FEM-Design.

public void RunAnalysis(Analysis analysis)

Parameters

analysis Analysis

The analysis to be run. Defaults to static analysis (StaticAnalysis(Comb, bool, bool))

RunAnalysis(Model, Analysis)

Opens model in FEM-Design and runs the analysis.

public void RunAnalysis(Model model, Analysis analysis)

Parameters

model Model
analysis Analysis

RunDesign(CmdUserModule, Design, List<CmdDesignGroup>)

Runs a design task on the current model in FEM-Design.

public void RunDesign(CmdUserModule userModule, Design design, List<CmdDesignGroup> designGroups = null)

Parameters

userModule CmdUserModule
design Design
designGroups List<CmdDesignGroup>

Exceptions

ArgumentException

RunDesign(Model, Design, CmdUserModule)

Opens model in FEM-Design and runs the design.

public void RunDesign(Model model, Design design, CmdUserModule userModule)

Parameters

model Model
design Design
userModule CmdUserModule

RunInteractionSurface(Bar, double, bool)

public InteractionSurface RunInteractionSurface(Bar bar, double offset = 0, bool fUlt = true)

Parameters

bar Bar
offset double
fUlt bool

Returns

InteractionSurface

RunInteractionSurface(List<IStructureElement>, double, bool)

public List<InteractionSurface> RunInteractionSurface(List<IStructureElement> bars, double offset = 0, bool fUlt = true)

Parameters

bars List<IStructureElement>
offset double
fUlt bool

Returns

List<InteractionSurface>

RunScript(FdScript, string)

Run a script and wait for it to finish.

public void RunScript(FdScript script, string filename = "script")

Parameters

script FdScript
filename string

Exceptions

ArgumentNullException

RunScriptAsync(FdScript, string)

Run a script and wait for it to finish.

public Task RunScriptAsync(FdScript script, string filename = "script")

Parameters

script FdScript
filename string

Returns

Task

Exceptions

ArgumentNullException

Save(string)

public void Save(string filePath)

Parameters

filePath string

SaveDocx(string, string)

Save the documentation in a docx file using a .bsc template file

public void SaveDocx(string docxFilePath, string templatePath = null)

Parameters

docxFilePath string

.docx file path where the documentatio will be saved

templatePath string

template .dsc file path to apply to the documentation

SetConfig(params CONFIG[])

Set design settings for a FEM-Design model.

public void SetConfig(params CONFIG[] configs)

Parameters

configs CONFIG[]

Configuration objects.

SetConfig(CmdConfig)

public void SetConfig(CmdConfig cmdConfig)

Parameters

cmdConfig CmdConfig

SetConfig(string)

Set design settings for a FEM-Design model using a configuration file.

public void SetConfig(string filepath)

Parameters

filepath string

Filepath of the configuration file.

SetFemDesignDirectory(string)

Retrieve the default FEM-Design installation directory or specify a custom directory path for FemDesignConnection.

public string SetFemDesignDirectory(string fdInstallationDir)

Parameters

fdInstallationDir string

FEM-Design software installation directory. If set to null, the default directory will be used.

Returns

string

The installation directory path.

Exceptions

ArgumentNullException

SetGlobalConfig(CmdGlobalCfg)

Set global settings for a FEM-Design model.

public void SetGlobalConfig(CmdGlobalCfg cmdglobalconfig)

Parameters

cmdglobalconfig CmdGlobalCfg

Global configuration object.

SetGlobalConfig(params GlobConfig[])

Set global settings for a FEM-Design model.

public void SetGlobalConfig(params GlobConfig[] globConfig)

Parameters

globConfig GlobConfig[]

Can be any type of configuration from CmdGlobalCfg (e.g. MeshGeneral, MeshSettings, Meshfunctions, etc.). See the properties of Calculate.CmdGlobalCfg class.

SetGlobalConfig(string)

Set global settings for a FEM-Design model using a global configuration file.

public void SetGlobalConfig(string filepath)

Parameters

filepath string

Filepath of the global configuration file.

SetProjDescription(CmdProjDescr)

public void SetProjDescription(CmdProjDescr cmdProjDescr)

Parameters

cmdProjDescr CmdProjDescr

SetProjDescription(string, string, string, string, string, List<UserDefinedData>)

public void SetProjDescription(string project, string description, string designer, string signature, string comment, List<UserDefinedData> items = null)

Parameters

project string
description string
designer string
signature string
comment string
items List<UserDefinedData>

SetVerbosity(Verbosity)

public void SetVerbosity(Verbosity verbosity)

Parameters

verbosity Verbosity