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
fdInstallationDirstringFEM-Design software installation directory.
minimizedboolOpen FEM-Design as a minimized window.
keepOpenboolIf true FEM-Design will be left open and have to be manually exited.
outputDirstringThe directory to save script files. If set to null, the files will be will be written to a temporary directory and deleted after.
tempOutputDirbool
If true theBE CAREFUL!outputDirwill be deleted on exit. This option has no effect unlessoutputDirhas been specified.verbosityVerbosity
Fields
DefaultVerbosity
public const Verbosity DefaultVerbosity = ScriptLogLinesOnly
Field Value
Properties
HasExited
public bool HasExited { get; }
Property Value
IsConnected
public bool IsConnected { get; }
Property Value
IsDisconnected
public bool IsDisconnected { get; }
Property Value
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
OutputDir
public string OutputDir { get; set; }
Property Value
Verbosity
public Verbosity Verbosity { get; }
Property Value
Methods
ApplyDesignChanges()
public void ApplyDesignChanges()
ApplyDocumentationTemplate(string)
Apply a template to a documentation
public void ApplyDocumentationTemplate(string templatePath)
Parameters
templatePathstring
CreateResultPoint(List<CmdResultPoint>)
Create a list of result points.
public void CreateResultPoint(List<CmdResultPoint> resultPoints)
Parameters
resultPointsList<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
lengthLengthUnit of length measurement. Default is meter.
Returns
GetFeaLineConnections()
Retrieve the line connection element data from the finite element model.
public List<LineConnectionElement> GetFeaLineConnections()
Returns
GetFeaLineSupports()
Retrieve the line support element data from the finite element model.
public List<LineSupportElement> GetFeaLineSupports()
Returns
GetFeaModel(Length)
Retrieve finite element data.
public FiniteElement GetFeaModel(Length units = Length.m)
Parameters
unitsLengthUnit of length measurement. Default is meter.
Returns
GetFeaNodes(Length)
Retrieve node geometry data from the finite element mesh.
public List<FemNode> GetFeaNodes(Length length = Length.m)
Parameters
lengthLengthUnit of length measurement. Default is meter.
Returns
GetFeaPointConnections()
Retrieve the point connection element data from the finite element model.
public List<PointConnectionElement> GetFeaPointConnections()
Returns
GetFeaPointSupports()
Retrieve the point support element data from the finite element model.
public List<PointSupportElement> GetFeaPointSupports()
Returns
GetFeaShells(Length)
Retrieve surface element data from the finite element mesh.
public List<FemShell> GetFeaShells(Length length = Length.m)
Parameters
lengthLengthUnit of length measurement. Default is meter.
Returns
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
loadCasesList<string>Load case names for which the results should be return.
elementIStructureElementOptional. Structural element for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult 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
loadCasesList<string>Load case names for which the results should be return.
elementsList<IStructureElement>Structural elements for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult 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
loadCasestringOptional. Load case name for which the results should be return.
elementIStructureElementOptional. Structural element for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult 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
loadCasestringLoad case name for which the results should be return.
elementsList<IStructureElement>Structural elements for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult 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
loadCombinationsList<string>Load combination names for which the results should be return.
elementIStructureElementOptional. Structural element for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult type to retrieve. Must be a type that implements the IResult interface
Exceptions
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
loadCombinationsList<string>Load combination names for which the results should be return.
elementsList<IStructureElement>Structural elements for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult type to retrieve. Must be a type that implements the IResult interface
Exceptions
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
loadCombinationstringOptional. Load combination name for which the results should be return.
elementIStructureElementOptional. Structural element for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult type to retrieve. Must be a type that implements the IResult interface
Exceptions
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
loadCombinationstringLoad combination name for which the results should be return.
elementsList<IStructureElement>Structural elements for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult type to retrieve. Must be a type that implements the IResult interface
Exceptions
GetLoadCombinations()
Retrieves the load combinations from the currently opened model/> object.
public Dictionary<int, LoadCombination> GetLoadCombinations()
Returns
GetLoads()
Retrieves the loads from the currently opened model with all available elements as a Loads object.
public Loads GetLoads()
Returns
GetModel()
Retrieves the currently opened model with all available elements as a Model object.
public Model GetModel()
Returns
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
unitsUnitResultsOptional. Unit setting for the results.
Returns
- List<T>
Type Parameters
TResult 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
inputBscPathstringoutputCsvPathstringelementList<IStructureElement>
Returns
Exceptions
GetResultsOnPoints<T>(ResultPoint, UnitResults)
public List<T> GetResultsOnPoints<T>(ResultPoint resultPoint, UnitResults units = null) where T : IResult
Parameters
resultPointResultPointunitsUnitResults
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
resultPointsList<ResultPoint>unitsUnitResults
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
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
elementsList<IStructureElement>Optional. Structural elements for which the results should be return.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult 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
loadCombinationstringOptional. Load combination name for which the results should be return.
shapeIdint?Optional. Shape identifier for which the results should be return.
unitsUnitResultsOptional. Unit setting for the results.
optionsOptionsOptional. Options to set up the output location.
Returns
- List<T>
List of results of type
Tif any could be retrieved. If the model has no results of typeTor cannot access them at the moment, then the list will be empty.
Type Parameters
TResult 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
fuboolfuaboolfusboolfsqboolfsfboolfscboolfSeisSignedboolfSeisTorsionboolfSeisZdirboolfSkipMinDLboolfForceTempboolfShortNamebool
Open(Model, bool)
Open a Model in FEM-Design application.
public void Open(Model model, bool disconnect = false)
Parameters
modelModelModel to be opened.
disconnectboolSet 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
filePathstringThe model file to be opened. Typically a .str or .struxml file, but any filetype supported in FEM-Design is valid.
disconnectboolSet 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
modelModelModel to be opened.
Returns
OpenAsync(string)
Open a file in FEM-Design application.
public Task OpenAsync(string filePath)
Parameters
filePathstringThe model file to be opened. Typically a .str or .struxml file, but any filetype supported in FEM-Design is valid.
Returns
RunAnalysis(Analysis)
Runs an analysis task on the current model in FEM-Design.
public void RunAnalysis(Analysis analysis)
Parameters
analysisAnalysisThe 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
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
userModuleCmdUserModuledesignDesigndesignGroupsList<CmdDesignGroup>
Exceptions
RunDesign(Model, Design, CmdUserModule)
Opens model in FEM-Design and runs the design.
public void RunDesign(Model model, Design design, CmdUserModule userModule)
Parameters
modelModeldesignDesignuserModuleCmdUserModule
RunInteractionSurface(Bar, double, bool)
public InteractionSurface RunInteractionSurface(Bar bar, double offset = 0, bool fUlt = true)
Parameters
Returns
RunInteractionSurface(List<IStructureElement>, double, bool)
public List<InteractionSurface> RunInteractionSurface(List<IStructureElement> bars, double offset = 0, bool fUlt = true)
Parameters
barsList<IStructureElement>offsetdoublefUltbool
Returns
RunScript(FdScript, string)
Run a script and wait for it to finish.
public void RunScript(FdScript script, string filename = "script")
Parameters
Exceptions
RunScriptAsync(FdScript, string)
Run a script and wait for it to finish.
public Task RunScriptAsync(FdScript script, string filename = "script")
Parameters
Returns
Exceptions
Save(string)
public void Save(string filePath)
Parameters
filePathstring
SaveDocx(string, string)
Save the documentation in a docx file using a .bsc template file
public void SaveDocx(string docxFilePath, string templatePath = null)
Parameters
docxFilePathstring.docx file path where the documentatio will be saved
templatePathstringtemplate .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
configsCONFIG[]Configuration objects.
SetConfig(CmdConfig)
public void SetConfig(CmdConfig cmdConfig)
Parameters
cmdConfigCmdConfig
SetConfig(string)
Set design settings for a FEM-Design model using a configuration file.
public void SetConfig(string filepath)
Parameters
filepathstringFilepath 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
fdInstallationDirstringFEM-Design software installation directory. If set to
null, the default directory will be used.
Returns
- string
The installation directory path.
Exceptions
SetGlobalConfig(CmdGlobalCfg)
Set global settings for a FEM-Design model.
public void SetGlobalConfig(CmdGlobalCfg cmdglobalconfig)
Parameters
cmdglobalconfigCmdGlobalCfgGlobal configuration object.
SetGlobalConfig(params GlobConfig[])
Set global settings for a FEM-Design model.
public void SetGlobalConfig(params GlobConfig[] globConfig)
Parameters
globConfigGlobConfig[]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
filepathstringFilepath of the global configuration file.
SetProjDescription(CmdProjDescr)
public void SetProjDescription(CmdProjDescr cmdProjDescr)
Parameters
cmdProjDescrCmdProjDescr
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
projectstringdescriptionstringdesignerstringsignaturestringcommentstringitemsList<UserDefinedData>
SetVerbosity(Verbosity)
public void SetVerbosity(Verbosity verbosity)
Parameters
verbosityVerbosity