George21
Marine/Ocean
- Dec 31, 2013
- 4
Hello,
I wrote a script in Femap using API. In this script there is running a static linear analysis for many times. After each analysis i need to read from model the T3 Constraint force on 2 nodes.
To read the Constraint Force i used the following script:
rc = App.feAppGetActiveView( viewID )
rc = feView.Get( viewID )
outSetID = feView.OutputSet
ouVec1.SetID = outSetID
rc = ouVec1.Get( 54 ) 'T3 Constraint Force
Dim feNode As femap.Node
Set feNode = App.feNode
While feNode.Next
If feNode.ID = NDpp Then
RT3pp = ouVec1.Value(feNode.ID)
Msg = " NDpp = " + Str$(RT3pp)
rc = App.feAppMessage( FCM_NORMAL, Msg )
End If
If feNode.ID = NDpv Then
RT3pv = ouVec1.Value(feNode.ID)
Msg = " NDpv = " + Str$(RT3pv)
rc = App.feAppMessage( FCM_NORMAL, Msg )
End If
Wend
This works fine if i have the output cases.
But here is the problem. I have a loop where i change the load case at each iteration (changing the value of pressure). I run analysis from API and after the analysis is complete the FEMAP doesn't create the output data and goes for the next analysis.
This is the script part for running analysis:
ldSetID = ldset.NextEmptyID
ldset.Put (ldSetID)
App.Info_ActiveID( FT_LOAD_DIR ) = ldSetID
elLoad.SetID = ldSetID
elID = elSet.First()
While elID <> FE_FAIL
el.Get( elID )
pval = (dsw- elZ) * dens * 9.81
If pval >0 Then
elLoad.meshID = elID
elLoad.type = FLT_EPRESSURE
elLoad.LoadValue = pval
elLoad.FaceNumber = 1
rc = elLoad.Put(elLoad.NextEmptyID)
End If
elID = elSet.Next()
Wend
am.Get (1)
am.BCSet (2) = ldSetID
am.Put(1)
am.Analyze (1)
While App.feFileProgramRunning()= FE_OK
Wait(5)
Wend
Can you please help me with a method and / or tips how to read the Constraint Forces on nodes after each analysis.
Thank you very much! And I hope, that my description is clear enough.
George
I wrote a script in Femap using API. In this script there is running a static linear analysis for many times. After each analysis i need to read from model the T3 Constraint force on 2 nodes.
To read the Constraint Force i used the following script:
rc = App.feAppGetActiveView( viewID )
rc = feView.Get( viewID )
outSetID = feView.OutputSet
ouVec1.SetID = outSetID
rc = ouVec1.Get( 54 ) 'T3 Constraint Force
Dim feNode As femap.Node
Set feNode = App.feNode
While feNode.Next
If feNode.ID = NDpp Then
RT3pp = ouVec1.Value(feNode.ID)
Msg = " NDpp = " + Str$(RT3pp)
rc = App.feAppMessage( FCM_NORMAL, Msg )
End If
If feNode.ID = NDpv Then
RT3pv = ouVec1.Value(feNode.ID)
Msg = " NDpv = " + Str$(RT3pv)
rc = App.feAppMessage( FCM_NORMAL, Msg )
End If
Wend
This works fine if i have the output cases.
But here is the problem. I have a loop where i change the load case at each iteration (changing the value of pressure). I run analysis from API and after the analysis is complete the FEMAP doesn't create the output data and goes for the next analysis.
This is the script part for running analysis:
ldSetID = ldset.NextEmptyID
ldset.Put (ldSetID)
App.Info_ActiveID( FT_LOAD_DIR ) = ldSetID
elLoad.SetID = ldSetID
elID = elSet.First()
While elID <> FE_FAIL
el.Get( elID )
pval = (dsw- elZ) * dens * 9.81
If pval >0 Then
elLoad.meshID = elID
elLoad.type = FLT_EPRESSURE
elLoad.LoadValue = pval
elLoad.FaceNumber = 1
rc = elLoad.Put(elLoad.NextEmptyID)
End If
elID = elSet.Next()
Wend
am.Get (1)
am.BCSet (2) = ldSetID
am.Put(1)
am.Analyze (1)
While App.feFileProgramRunning()= FE_OK
Wait(5)
Wend
Can you please help me with a method and / or tips how to read the Constraint Forces on nodes after each analysis.
Thank you very much! And I hope, that my description is clear enough.
George