edmiUsedInBN
EdmiError edmiUsedInBN(SdaiAppInstance instance, SdaiString roleName, SdaiInteger options, SdaiInteger *membersInResult, void *result);
Implements the Express built in function UsedIn as defined in section 15.26 UsedIn – general function; in ISO 10303-11:1994(E) : The EXPRESS Language Reference Manual. This operation is only applicable on data models. The actual data model must be open before this operation can be successfully performed.
Arguments
Type | Name | Comment |
SdaiAppInstance | instance | A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase. |
SdaiString | roleName | Specifies the name of the role of interest. Role names are case insensitive. A role name is the same as an attribute name. This argument can be set to NULL, meaning that any role the actual <instance> plays will be returned by this function. |
SdaiInteger | options | Specifies the options that are enabled in the invocation of the edmiUsedIn function. The <options> value should be specified as a bitwise OR between the options to enable. All option names are defined in the header file sdai.h . See detailed descriptions of the available options below. |
SdaiInteger | membersInResult | Address of a SdaiInteger variable that will receive the returned number of elements in the result data set. |
void | result | Address of a variable that will receive the aggregateID of the scratch aggregate or address of the memory buffer that holds the resulting data set. |
Return Value
Options
Option | Comment |
---|---|
AS_SCRATCH_AGGR | The result of the operation will be returned in a new created scratch aggregate. The scratch aggregate will be a BAG OF ENTITY_INSTANCE. A numeric aggregateID that uniquely identifies the resulting scratch aggregate instance will be returned in the <result> argument. AS_SCRATCH_AGGR is the default value of the <options> argument. |
AS_MEMORY_BUFFER | The operation result aggregate will be returned as a memory buffer in the calling application's virtual memory. The memory address (byte address) of the memory buffer will be returned in the <result> argument. The memory buffer will be an array of SdaiInstance. The virtual memory in the calling application's memory will be allocated by EDMinterface. This virtual memory should be released by the calling application, using the EDMinterface operation edmiFree when the data is no longer needed by the application. |
Example
EdmiError rstat; SdaiAppInstance instance, result, *p; SdaiInteger membersInResult; int i; . . . if (rstat = edmiUsedInBN (instance, "Father", AS_MEMORY_BUFFER, &membersInResult, (void *) &result)) { /* Error in operation */ printf("\nError: %s in edmiUsedInBN\n", edmiGetErrorText(rstat)); goto error; } /* Printing out all the instances that uses the specified instance in the specified role */ p = result; for (i = 0; i < membersInResult; i++) { printf("\nInstanceId: %lu", *p); ++p; } edmiFree((void *) result); . . .
See also
Filter by label
There are no items with the selected labels at this time.