Femap_invoke (+FEA)


Purpose

Invoke a Femap API method through the COM interface.

Syntax

[RC[,OUT1,OUT2...]]=Femap_INVOKE(OBJ,METHOD,[,ARG1,ARG2,...])

Description

Femap_INVOKE calls a method on the Femap object specified in OBJ. This method works basically identically as the MATLAB native method, but is necessary for methods that have both inputs and outputs in the argument list.

Femap_INVOKE will first search through its supported list of methods to see if it is one with input and output arguments that has already been implemented. If so, it will call a special handler for the method. For these calls, you must always pass the input arguments to the function in ARG1, ARG2, and so on. The output arguments are specified in the output to Femap_INVOKE.

In addition to the methods described in the Femap API, Femap_INVOKE does provide some additional methods for more efficiently getting and putting object properties. The GetProperties method will return a structure containing all of the object's properties, and the SetProperties method accepts a structure of the same form. It will set the properties for all of the fields of the input structure that it recognizes. The objects for which these methods are provided are shown below.

Object Method Description
Output

[RC,OUT] = Femap_invoke(OP,'GetProperties')

OP is a feOutput object. It must have its ID and SetID properties set appropriately. OUT is a structure containing the properties.
Output RC=Femap_invoke(OP,'PutProperties',SPROP)

OP is a feOutput object. It must have its ID and SetID properties set appropriately. SPROP is a structure containing the properties.

OutputSet [RC,OUT] = Femap_invoke(OPS,'GetProperties') OP is a feOutputSet object. It must have its ID and SetID properties set appropriately. OUT is a structure containing the properties.
OutputSet RC=Femap_invoke(OPS,'PutProperties',SPROP)

OP is a feOutputSet object. It must have its ID and SetID properties set appropriately. SPROP is a structure containing the properties.

 

If the method is not found in the supported list, it will attempt to invoke the method by calling the MATLAB INVOKE function. Thus for methods that have only input arguments in the argument list, INVOKE and Femap_INVOKE are interchangeable.

RC is the return call. If an error occurred, RC will be a structure with the fields .errnum and .errstr. If the method was successful, it will contain the return value from the method.

femap_invoke('new') causes this function to use the new (Femap 2020+) Mex functionality that utilizes the Results methods for writing results to Femap. Initialize FEMAP_INVOKE with this option before using it. This setup supports Femap 2020+. The default supports Femap 11.3.0 through 2020+, but writing results using the Results object does not work. The two cannot be used interchangeably.

Please note thta Femap_INVOKE by no means supports the exhaustive list of Femap API method calls. If the function you are trying to use has output arguments, and Femap_INVOKE returns an error and you are calling it correctly, chances are that this method is not yet supported. If so, please file a TIER report.

Example

>> happ = actxserver('Femap.model');
>> node = invoke(happ,'feNode');
>> node = Femap_invoke(happ,'feNode');          % This line is equivalent to the one above it
>> setid = int32(0);
>> [rc,nnod,ids,xyz,lay,col,typ,dcs,ocs,pbc] = Femap_invoke(node,'GetAllArray',setid);

 

See Also

writeFemap