ACAPI_​ListData_​GetLocal

Retrieves the data of a local listing component.

    GSErrCode  ACAPI_ListData_GetLocal (
        Int32                    libIndex,
        const API_Elem_Head*     elemHead,
        API_ListData*            listdata
    );

 

Parameters

libIndex
[in] Index of the library part.
elemHead Changed in API 17
[in] Element of the placed object instance (see remarks).
listdata
[in/out] Parameters of the listdata. The type of the listdata must be passed in the typeID field in the listdata header. The index in the library part must be passed in the index field in the listdata header. The other fields of the structure are filled in automatically.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
Invalid libIndex was passed.
APIERR_BADID
Invalid listdata type was passed.

For other common API errors see the API Errors document.

 

Remarks

This function is used to get a local component or descriptor in the library part defined by libIndex and typeID, the index field of the listdata header. The information of a given listdata is returned in the fields of the listdata. If the given listdata is in the listing database, use the ACAPI_ListData_Get function instead.

When getting the local listdata, the applicable fields should be filled.

API_ListData_Head

index

required

typeID (only for API_Obsolete_ComponentID and API_DescriptorID)

required

libIndex

required

If you are retrieving a descriptor, do not forget to dispose of the name handle when you’re finished.

Changed in API 11  If the listing result depends on the current settings of the library part parameters (which is possible when the component or descriptor definitions in the property script of the object refer to GDL parameters of the object), you might need to get the correct data to be listed for a placed element. In this case you need to pass the appropriate elemTypeID and elemIndex parameters. Otherwise these values should be API_ZombieElemID and 0 respectively.

 

Example


API_LibPart   libPart;
API_ListData  listdata;
API_Elem_Head head;
Int32         libIndex;
GSErrCode     err;

BNZeroMemory (&libPart, sizeof (API_LibPart));
BNZeroMemory (&head, sizeof (API_Elem_Head));

libPart.typeID = APILib_PropertyID;
GS::ucscpy (libPart.docu_UName, L("Test property"));

err = ACAPI_LibPart_Search (&libPart, false);
delete libPart.location;

if (err == NoError && libPart.index != 0) {
    libIndex = libPart.index;

    BNZeroMemory (&listdata, sizeof (API_ListData));
    listdata.header.typeID = API_Obsolete_ComponentID;
    listdata.header.index  = 1;

    err = ACAPI_ListData_GetLocal (libIndex, &head, &listdata);
}

 

Requirements

Version: API 2.1 or later
Header: ACAPinc.h

 

See Also

API_ListData,
ACAPI_ListData_Get,
Listing Manager, API Functions