Skip to main content

Motion Standalone Preprocessor C# library 2025 R1

Class Api

Last update: 16.07.2025

Namespace: VM.Managed.DAFUL.Pre
Assembly: dfpreAPI.dll

This class is to represent API for DAFUL.

public class Api : IPre, IMainWindow

Inheritance

objectApi

Implements

IPre, IMainWindow

Extension Methods

LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType), LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType), LinkPropertyItemCache.GetLinkedObjects(object, LinkPropertyType)

Properties

ActiveDocument

Gets the active document. [Not Implementation]

public IDocument ActiveDocument { get; set; }

Property Value

IDocument

ActiveDocumentViewModel

Gets the active DocumentViewModel

public IDocumentViewModel ActiveDocumentViewModel { get; }

Property Value

IDocumentViewModel

ActiveModel

Gets the active model.

public Model ActiveModel { get; }

Property Value

Model

ActiveWork

Gets the active work.

public Work ActiveWork { get; }

Property Value

Work

ApplicationCore

Gets the application core.

public Application ApplicationCore { get; }

Property Value

Application

DialogManager

Gets the dialog manager.

public IDlgManager DialogManager { get; }

Property Value

IDlgManager

GlobalJournal

Gets the global journal.

public JournalRecorder GlobalJournal { get; }

Property Value

JournalRecorder

LocalJournal

Gets the local journal.

public JournalRecorder LocalJournal { get; }

Property Value

JournalRecorder

MainWindow

Gets the main window. [Not Implementation]

public IMainWindow MainWindow { get; }

Property Value

IMainWindow

UnUseMRU

Gets or sets a value indicating whether [un use MRU].

public bool UnUseMRU { get; set; }

Property Value

bool

Version

Gets the version.

public string Version { get; }

Property Value

string

WriteDFG

Gets or sets the WriteDFG flag. [Not Implementation]

public bool WriteDFG { get; set; }

Property Value

bool

Methods

ActiveDocChanged()

Activate changed document.

public void ActiveDocChanged()

ActiveViewChanged()

Activate changed view.

public void ActiveViewChanged()

AutoSave()

Auto save. [Not Implementation]

public void AutoSave()

CanSimulation(bool)

Determines whether this instance can simulation the specified can. [Not Implementation]

public void CanSimulation(bool bCan)

Parameters

bCan bool

if set to true [can].

ClearMessage(string)

Clear Message. [Not Implementation]

public void ClearMessage(string strName)

Parameters

strName string

Name.

CloseAllFile()

Closes all file.

public void CloseAllFile()

CloseAllFileExceptWork()

Closes all file except work.

public void CloseAllFileExceptWork()

CloseDocument(Document)

Closes the file.

public bool CloseDocument(Document doc)

Parameters

doc Document

The to close.

Returns

bool

CloseFile(string)

Closes the file.

public bool CloseFile(string strFileName)

Parameters

strFileName string

Name of the file.

Returns

bool

true if success; otherwise, false.

CloseFile(string, bool)

Closes the file.

public bool CloseFile(string strFileName, bool bUseWork)

Parameters

strFileName string

Name of the STR file.

bUseWork bool

if set to true [b use work].

Returns

bool

CloseFile(string, bool, bool)

Closes the file.

public bool CloseFile(string strFileName, bool bUseWork, bool bActivate)

Parameters

strFileName string

Name of the string file.

bUseWork bool

if set to true [b use work].

bActivate bool

if set to true [b activate].

Returns

bool

CloseHiddenFile(string)

Closes the hidden file.

public bool CloseHiddenFile(string strFileName)

Parameters

strFileName string

Name of the string file.

Returns

bool

CloseWork()

Close work.

public void CloseWork()

CreateDocument(string)

Creates the document.

public Document CreateDocument(string strFileName)

Parameters

strFileName string

Name of the file.

Returns

Document

The document.

CreateDocument(string, bool)

Creates the document.

public Document CreateDocument(string strFileName, bool bActivate)

Parameters

strFileName string

Name of the file.

bActivate bool

if set to true [b activate].

Returns

Document

The document.

CreateDocument(string, bool, string)

Creates the document.

public Document CreateDocument(string strFileName, bool bActivate, string strDocCreateInfo)

Parameters

strFileName string

Name of the STR file.

bActivate bool

if set to true [b activate].

strDocCreateInfo string

The STR doc create info.

Returns

Document

CreateDocument(string, bool, string, bool)

Creates the document.

public Document CreateDocument(string strFileName, bool bActivate, string strDocCreateInfo, bool bDesigner)

Parameters

strFileName string

Name of the string file.

bActivate bool

if set to true [b activate].

strDocCreateInfo string

The string document create information.

bDesigner bool

if set to true [b designer].

Returns

Document

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Dispose()

public void Dispose()

EndOutput(string)

Ends the output. [Not Implementation]

public void EndOutput(string strName)

Parameters

strName string

Name.

~Api()

Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection.

protected ~Api()

Fit(string)

Fits this instance.

public void Fit(string strPathName)

Parameters

strPathName string

Name of the string path.

GetAllOpenDocument()

Gets all opend document.

public List<document> GetAllOpenDocument()

Returns

List

GetDocumentFromOpenedDocument(string)

Gets the document from opened document.

public Document GetDocumentFromOpenedDocument(string strFileName)

Parameters

strFileName string

Name of the file.

Returns

Document

GetMode()

Gets the mode.

public string GetMode()

Returns

string

The mode type

IsOpenDocument(string)

Determines whether [is open document] [the specified STR file name].

public bool IsOpenDocument(string strFileName)

Parameters

strFileName string

Name of the file.

Returns

bool

true if [is open document] [the specified STR file name]; otherwise, false.

IsRunningSimulation()

Determines whether [is running simulation].

public bool IsRunningSimulation()

Returns

bool

NewFile(NewFile)

New file.

public void NewFile(NewFile nf)

Parameters

nf NewFile

The new file information.

NewModel(NewModel)

New model.

public void NewModel(NewModel nM)

Parameters

nM NewModel

The new model information.

OpenDocument(string)

Opens the document.

public Document OpenDocument(string strFileName)

Parameters

strFileName string

Name of the file.

Returns

Document

The document.

OpenDocument(string, bool)

Opens the document.

public Document OpenDocument(string strFileName, bool bActivate)

Parameters

strFileName string

Name of the file.

bActivate bool

if set to true [b activate].

Returns

Document

The document.

OpenDocument(string, string, bool)

Opens the document.

public Document OpenDocument(string strFileName, string strRelatedPath, bool bActivate)

Parameters

strFileName string

Name of the STR file.

strRelatedPath string

The STR related path.

bActivate bool

if set to true [b activate].

Returns

Document

OpenDocumentFile(string)

Opens the document file.

public Document OpenDocumentFile(string strFileName)

Parameters

strFileName string

Name of the STR file.

Returns

Document

OpenFile(string, string)

Opens the file.

public GroupItem OpenFile(string strFileName, string strRefDir)

Parameters

strFileName string

Name of the file.

strRefDir string

The reference directory.

Returns

GroupItem

The file informaton class.

OpenFileDialogAsMainWindow(OpenFileDialogInfo)

Opens the file dialog as main window. [Not Implementation]

public string OpenFileDialogAsMainWindow(OpenFileDialogInfo info)

Parameters

info OpenFileDialogInfo

The info.

Returns

string

the file name

OpenHiddenDocument(object)

Opens the hidden document.

public Document OpenHiddenDocument(object obj)

Parameters

obj object

The object.

Returns

Document

OpenModel(string)

Opens the model.

public Model OpenModel(string strFileName)

Parameters

strFileName string

Name of the file.

Returns

Model

The model.

OpenWork(string)

Opens the work.

public Work OpenWork(string strFileName)

Parameters

strFileName string

Name of the STR file.

Returns

Work

PrepareSimulation()

Prepares the simulation. [Not Implementation]

public bool PrepareSimulation()

Returns

bool

true if success; otherwise, false.

ReadAllText(string, string)

Reads all text. [Not Implementation]

public void ReadAllText(string strPath, string strName)

Parameters

strPath string

The path.

strName string

Name.

ReadAllText(string, string, bool)

Reads all text.

public void ReadAllText(string strPath, string strName, bool bDeleteFIle)

Parameters

strPath string

The STR path.

strName string

Name of the STR.

bDeleteFIle bool

if set to true [b delete F ile].

SaveAllFile()

Saves all file.

public SaveAllResult SaveAllFile()

Returns

SaveAllResult

SaveFile()

Save the file.

public void SaveFile()

SaveFile(string)

Saves the file.

public void SaveFile(string strPath)

Parameters

strPath string

The path.

SaveFile(Document, string)

Saves the file.

public void SaveFile(Document doc, string strFileName)

Parameters

doc Document

The doc.

strFileName string

Name of the STR file.

SaveFile(Document, string, bool)

Saves the file.

public void SaveFile(Document doc, string strFileName, bool bIgnoreExternChange)

Parameters

doc Document

The doc.

strFileName string

Name of the STR file.

bIgnoreExternChange bool

if set to true [b ignore extern change].

SaveFileDialogAsMainWindow(SaveFileDialogInfo)

Saves the file dialog as main window. [Not Implementation]

public string SaveFileDialogAsMainWindow(SaveFileDialogInfo info)

Parameters

info SaveFileDialogInfo

The info.

Returns

string

the file name

SaveModel(string)

Saves the model.

public void SaveModel(string strFileName)

Parameters

strFileName string

Name of the file.

SaveWork(string)

Saves the work.

public void SaveWork(string strFileName)

Parameters

strFileName string

Name of the file.

SetEnableOfTabCtrl(object, bool)

Sets enable or disable of Tab..

public void SetEnableOfTabCtrl(object obj, bool bEnable)

Parameters

obj object

The current document.

bEnable bool

if set to true [is enable].

SetIntervalForAutoSize()

Sets the size of the interval for auto. [Not Implementation]

public void SetIntervalForAutoSize()

SetPathName(string, string)

Set path name.

public void SetPathName(string strOldPath, string strNewPath)

Parameters

strOldPath string

The old path.

strNewPath string

The new path.

SetProgressState(int)

Set taskbar progress state.

public void SetProgressState(int nStats)

Parameters

nStats int

0x0 : NOPROGRESS, 0x1 : INDETERMINATE, 0x2 : NORMAL, 0x4 : ERROR, 0x8 : PAUSED

SetProgressValue(ulong, ulong)

Set taskbar progress value.

public void SetProgressValue(ulong nCompleted, ulong nTotal)

Parameters

nCompleted ulong

The completed value.

nTotal ulong

The total value.

SetSimulationParameters(string, string)

Sets the simulation parameters. [Not Implementation]

public bool SetSimulationParameters(string strEndTime, string strStepSize)

Parameters

strEndTime string

The end time.

strStepSize string

Size of the step.

Returns

bool

true if success; otherwise, false.

SetStatusBar(string)

Set status bar.

public void SetStatusBar(string strMessage)

Parameters

strMessage string

The message.

Start()

Start Api instance

public static Api Start()

Returns

Api

new Api instancce

Start(string)

Start Api instance.

public static Api Start(string strKernelPath)

Parameters

strKernelPath string

The kernel path.

Returns

Api

new Api instancce

Start(string, string)

Start Api instance.

public static Api Start(string strKernelPath, string strTranslatorDir)

Parameters

strKernelPath string

The kernel path.

strTranslatorDir string

The translator directory.

Returns

Api

new Api instancce

Start(ApiStartOptions)

Start Api instance with given

public static Api Start(ApiStartOptions options)

Parameters

options ApiStartOptions

The .

Returns

Api

new Api instance

StartOperationStatus()

Starts the operation status.

public void StartOperationStatus()

StartOutput(string, string)

Starts the output. [Not Implementation]

public void StartOutput(string strPath, string strName)

Parameters

strPath string

The path.

strName string

Name.

UseSession(string)

Get session object to menage operation session

public ISession UseSession(string strSessionName)

Parameters

strSessionName string

The name of the session

Returns

ISession

The object

UseSession(IOperation)

Get session object to menage operation session

public ISession UseSession(IOperation operation)

Parameters

operation IOperation

The will be executed.

Returns

ISession

The object

OnActiveDocumentChanged

Occurs when [on active document changed]. [Not Implementation]

public event EventHandler OnActiveDocumentChanged

Event Type

EventHandler

OnActiveViewChanged

Occurs when [on active view changed]. [Not Implementation]

public event EventHandler OnActiveViewChanged

Event Type

EventHandler

Connect with Ansys