Cancel
Showing results for 
Search instead for 
Did you mean: 

API - Activate analysis set

Creator
Creator

Hi all,

 

I am trying to create a Custom Tool in FEMAP 11.3 that essentially exports a Nastran Analysis Model and then calls a .bat/.cmd file to run the file on our Nastran server.

I am able to set a name for the file and export it, unfortunately it only does this for the Active Analysis Set. Therefore I want to select the Active Analysis Set but I am unable to do so, like done through File --> Export --> Analysis Model.

The code I have so far is:

 

Sub Main
	'-------------------------------------- The declarations --------------------------------------
	' FEMAP itself
        Dim App As femap.model
        Set App = feFemap()
        ' The Analysis Set Manager
        Dim AnaMgr As femap.AnalysisMgr
	Set AnaMgr = App.feAnalysisMgr

	 ' Some other variables
 	Dim NasFile As Long
 	Dim fName As String

 	'------------------------------------------ The script ------------------------------------------
	 ' Select the Analysis Set to run
	AnaMgr.SelectID("Select")
	AnaMgr.Put(AnaMgr.ID)

	'Get the filename of the NASTRAN file
	NasFile = App.feFileGetName ("Write model to NASTRAN", "NASTRAN","*.bdf;*.nas", False, fName)

	' Write the NASTRAN file with the name as specified
	App.feFileWriteNastran(0,fName )

End Sub

 

It seems that AnalysisMgr.Put does not actually activate the analysis set, at least not for the feFileWriteNastran command. How can I activate an specific Analysis Set?

 

Regards,

Gertjan

 

 

2 REPLIES

Re: API - Activate analysis set

Phenom
Phenom
You could set the Global Integer property:
App.Info_ActiveID(FT_AMGR_DIR) = <ID>

Where <ID> is the value of the Analysis Set id you wish to run.

Or are you wanting the user to graphically select from the list?

Re: API - Activate analysis set

Creator
Creator
This works exactly how I wanted it to.
I do not want the user to select it graphically.