Graphisoft®

API Development KitVersion: 18

ACAPI_Element_GetDescriptors

요소의 descriptor들을 리턴합니다.

    GSErrCode  ACAPI_Element_GetDescriptors (
        const API_Elem_Head*         elemHead,
        API_DescriptorRefType***     descRef,
        Int32*                       nDesc
    );

 

파라미터

elemHead
[in] descriptor들을 가져올 요소입니다.
descRef
[out] descriptor들의 리스트입니다.
nDesc
[out] 리스트 내 descriptor들의 개수입니다.

리턴 값

APIERR_BADPARS
descRef가 NULL이거나 nDesc가 NULL입니다.
APIERR_BADID
올바르지 않은 elemHead를 지정했습니다.
APIERR_MEMFULL
descriptor들을 가져오기에는 메모리가 부족합니다.

다른 공통 API 오류들에 대해서는 API 오류 문서를 보십시오.

 

설명

이 함수는 요소의 모든 descriptor에 대한 정보를 가져오는 데 사용합니다. 이 descriptor들은 요소의 프로퍼티 객체들 안에 있습니다. 이것은 모든 건설 요소들에게 적용됩니다.

 

예제

void GetDiscriptors (const API_Guid& guid)
{
    API_Elem_Head          elemHead;
    API_DescriptorRefType  **descRefs;
    API_ListData           listdata;
    Int32                  nDesc, i;
    char                   s[256];
    GSErrCode              err;

    BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
    elemHead.guid = guid;

    err = ACAPI_Element_GetDescriptors (&elemHead, &descRefs, &nDesc);
    if (err == NoError) {
        for (i = 0; i < nDesc; i++) {
            listdata.header.typeID   = API_ComponentID;
            listdata.header.index    = (*descRefs)[i].index;
            listdata.header.setIndex = (*descRefs)[i].setIndex;
            if ((*descRefs)[i].status != APIDBRef_Deleted) {
                BNZeroMemory (&listdata, sizeof (API_ListData));
                listdata.header.typeID   = API_DescriptorID;
                listdata.header.setIndex = (*descRefs)[i].setIndex;
                listdata.header.index    = (*descRefs)[i].index;
                switch ((*descRefs)[i].status) {
                    case APIDBRef_Normal:
                        err = ACAPI_ListData_Get (&listdata);
                        break;
                    case APIDBRef_Local:
                        err = ACAPI_ListData_GetLocal ((*descRefs)[i].libIndex, &listdata);
                        break;
                }
            }
            if (err == NoError) {
                sprintf (s, "Keycode/code: \"%s\"/\"%s\"", listdata.descriptor.keycode, listdata.descriptor.code);
                ACAPI_WriteReport (s, false);
                ACAPI_WriteReport (*(listdata.descriptor.name), false);
            }
            BMKillHandle (&listdata.descriptor.name);
        }
        BMKillHandle ((GSHandle *) &descRefs);
    }
}

 

요구사항

버전: API 2.1 또는 이후
헤더: ACAPinc.h

 

참고사항

API_ElemTypeID, API_DescriptorRefType,
요소 관리자, 리스팅 관리자, API 함수