Cancel
Showing results for 
Search instead for 
Did you mean: 

API - Getting associated loads

Experimenter
Experimenter

Hi,

I am new using the API of FEMAP.

Which command on API do I use to get the associated loads and loadcases of a specific node?

 

Is "command" the correct name?

 

 

 

6 REPLIES

Re: API - Getting associated loads

Phenom
Phenom

You probably want the LoadMesh Object, which has the GetSearch method.

Re: API - Getting associated loads

Experimenter
Experimenter

Thanks EndZ for the information.

 

I've been trying to store the loads (force X, force Y , force Z)  of a specific node in an array (only one Loadcase in the model). 

Later I want do some math operations with that array and store as a new output.

How can that be done?

 

This is what I was trying but it does not work.

 

Sub Main
    Dim App As femap.model
    Set App = feFemap()
 
    Dim Loads As femap.LoadMesh
    Set Loads = App.feLoadMesh
 
    Dim ForceArray()
 
    'Get forces (Fx,Fy,Fz) on node 1 and store in ForceArray
    ForceArray = Loads.GetSearch( nForce, 1, 0 )
 
End Sub

 

 

Re: API - Getting associated loads

Siemens Phenom Siemens Phenom
Siemens Phenom

The GetSearch method does not return the values of the load as you coded as it returns FE_OK if the entity ID is loaded with the load type specified in the method.

 

Try this code instead.

 

Sub Main
    Dim App As femap.model
    Set App = feFemap()
 
    Dim rc As femap.zReturnCode
 
    app.feLoadSet.Active = 1
 
    Dim Loads As femap.LoadMesh
    Set Loads = App.feLoadMesh
 
    Dim ForceArray(3) As Double
 
    'Get forces (Fx,Fy,Fz) on node 1 and store in ForceArray
    rc = Loads.GetSearch( FLT_NFORCE, 1, 0 )
    If rc = FE_OK Then  'Node has a Force Applied
        For i = 0 to 2
            ForceArray(i) = Loads.load(i)
        Next i
    End If
 
End Sub
Best Regards,
Chip Fricke
Principal Applications Engineer - Femap Product Development

Re: API - Getting associated loads

Phenom
Phenom

If you are learning the API, be mindful of the methods with Return Codes.  "Outputs" are usually indicated as an Output for the method in the API.pdf - or you can typically use Properties as "output".  However, when a method has a Return Code, then if you use something like:

 

Output = Some.Method(param1, param2, param3...)

 

   then you are simply assigning the Return Code to the Output.  The Return Code is typically just a small integer value (see Global Constants in the API.pdf) which indicates success, failure, or otherwise of the method.

Re: API - Getting associated loads

Experimenter
Experimenter
Thanks Chip Fricke. It helped a lot, and worked fine.

Re: API - Getting associated loads

Experimenter
Experimenter
Thanks End Z. Now I am having a better understanding of the API language.
" use Properties as "output" " is what was missing for me to achieve my goals.