Cancel
Showing results for 
Search instead for 
Did you mean: 

Map from Model Output process using API??

Creator
Creator

Dear All,

 

I am tring to automate  "thermal map from Model output" procedure using API. 

I've used  "MapFromModelToSet" example in API manual book to do this Job, but it seems that it deos not work as what I want to do (Model->output- From load-> Select type of load"nodel Load" is empty) 

Would you kindly give me the tip or example how I should do it using API? 

Attached file shows Femap menu command. 

 

Many thanks,

John kang

2 REPLIES

Re: Map from Model Output process using API??

Siemens Phenom Siemens Phenom
Siemens Phenom

If you are getting your loads to map correctly, it sounds like you may just need to create a new output set first.  Go to Model > Output > Create/Manage Set.  Once created, go back into Model > Output and the 'From Load' option should now be possible.

 

Below is my slight modification to the example MapFromModelToSet found in section 5.42.2.1 of the FEMAP Help.  This will map temperature loads,  with nodal target, interpolated.  Update srcGroup, srcSet, and srcVector to your desired Group, Output Set, and Output Vector, respectively, as well as the model name you are mapping from.

Sub Main
    Dim App As femap.model
    Set App = feFemap()

     Dim ret As Integer

     Set map = App.feMapOutput

     Dim s As Set
     Set s = App.feSet

'1 Create target Set
     rc = s.Select(FT_NODE, True, "Nodes" )

     If s.Count = 0 Then
           Exit Sub
     End If

     map.TargetSet = s.ID

'2 Set No-map preference
  map.MapOption = femap.FMO_INTERP


'3 Set Default values
  map.DefaultMapValue1 = 0.0
  map.DefaultMapValue2 = 0.0
  map.DefaultMapValue3 = 0.0

'4 Set element/Node conversion If any
     map.MapToType = femap.FMP_NODE

'5 Set output load Type
  'map.loadType = femap.FMLT_NDISPLACEMENT
  map.loadType = femap.FMLT_NTEMPERATURE

'6 Get Model ID
     Dim modelID As Long
     Dim vModelID As Variant
     Dim num As Long
     Dim modelName As String

     modelName  ="C:\Example.modfem"

     rc = App.feAppGetAllModels(num, vModelID)

     For e=0 To num

           rc = App.feAppGetModelName(vModelID(e), modelName)

           If modelName <> App.ModelName Then
                 modelID = vModelID(e)
                 Debug.Print modelID;  " - "; modelName
                 Exit For
           End If
     Next

Dim srcGroup As Long
     Dim srcSet As Long
     Dim srcVector As Long

     srcGroup =1
     srcSet = 1
     srcVector = 31

      ret = map.MapFromModelToSet(modelID,  srcGroup, srcSet, srcVector)

End Sub

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Re: Map from Model Output process using API??

Creator
Creator

Dear Ryan,

Thanks for your response. It was very useful information and I completed it by adding 'feLoadSet' (Model->Output->....Nodal Temperature..Done')' and 'feOutSet' (Model->Output->From Load.....Nodal loads-> Temperature)...functions between MapFromModelToSet. This allows me to create Analysis Set for generating ABAQUS input file (Please see the Below).

 

Using code below, it was successfully generate ABAQUS Analysis Set, but I cannot manage to toggle on the AbdModTitleSetNames and AbdModGroupsAsSet, which are the Analsys Set Option- ABAQUS Specific.

'Write Entity Titles as Set Name' must be toggle on and 'Wrte All Groups as Set '(Toggle off) in Set Options in attached file. Is there any way or funcion to access the Analsys Set Option for ABAQUS Specific???

It is very hard to find some examples for FEMAP API, compared with ABAQUS Subroutine. It would very appreciate, if you can give me a tip!!!:-D 

 

Many thanks & Best Regards,

John Kang

 

  AnaMgr.AbaModTitleSetNames=True
  AnaMgr.AbaModGroupsAsSets = False

 

 

                Dim NasFile As Long
                Dim fName As String
                Dim analysis_set As Object
                Dim solver As Integer
                Dim analysis_type As Integer
                Dim AbaVersion As Integer
                Dim AnaMgr As femap.AnalysisMgr
                Set AnaMgr = App.feAnalysisMgr

                AnaMgr.title = "ABAQUS " + Str$(ldSetID)+"
                solver =16
                analysis_type=20
                AbaVersion = 62

                AnaMgr.Solver=solver
                AnaMgr.AnalysisType=analysis_type
                AnaMgr.LaunchWithVisQ=False
                AnaMgr.AbaModVersion=AbaVersion
                AnaMgr.AbaModTitleSetNames=True
                AnaMgr.AbaModGroupsAsSets = False
                AnaMgr.AbaHistAnalysisType=analysis_type
                AnaMgr.AbaHistTimePeriod= 1
                AnaMgr.AbaHistInitTimeInc= 0.1
                AnaMgr.AbaHistMinTimeInc = 1e-5
                AnaMgr.AbaHistMaxTimeInc  = 1
                AnaMgr.BCSet(2)=1
                AnaMgr.BCSet(3)=1
                AnaMgr.Output(5)=0

                rc = AnaMgr.Put( AnaMgr.NextEmptyID )
                App.Info_ActiveID( FT_OUT_CASE ) = AnaMgr.ID