Graphisoft®

API Development KitVersion: 18

ACAPI_Element_GetConnectedElements

주어진 요소에 연결된 요소들의 리스트를 리턴합니다.

    GSErrCode  ACAPI_Element_GetConnectedElements (
        const API_Guid&          guid,
        API_ElemTypeID           connectedElemTypeID,
        GS::Array<API_Guid>*     connectedElements,
        API_ElemFilterFlags      filterBits = APIFilt_None,
        API_ElemVariationID      variationID = APIVarId_Generic
        const API_Guid&          renovationFilterGuid = APINULLGuid
    );

 

파라미터

guid
[in] 연결되어 있는 다른 요소들을 가진 요소의 식별자입니다.
connectedElemTypeID
[in] 가져올 연결된 요소들의 타입입니다. 현재 적용 가능한 타입들은 다음과 같습니다: API_WindowID, API_DoorID (Wall 요소와 함께), API_SkylightID (Roof 및 Shell 요소와 함께)
connectedElements
[out] 가져온 연결된 요소들의 guid 리스트입니다.
filterBits
[in] 필터링을 위해 사용되는 flag들입니다. (ACAPI_Element_Filter를 보십시오) 기본값은 APIFilt_None입니다.
variationID
[in] 객체들에 대한 선택적인 variation ID입니다. 이 파라미터는 현재 무시합니다.
renovationFilterGuid Featuring API 17
[in] 리노베이션 필터의 선택적인 글로벌 유일 식별자입니다. 이 파라미터는 현재 무시합니다.

 

리턴 값

NoError
함수가 성공적으로 완료되었습니다.
APIERR_BADPARS
connectedElements 포인터가 NULL입니다.
APIERR_BADID
guid 파라미터가 유효한 요소를 식별하지 않습니다. 또는 주어진 요소 타입이 요청한 타입의 요소들과 연결될 수 없습니다.

 

설명

이 함수는 주어진 타입과 variation을 가진 요소들을 가져오는 데 사용할 수 있습니다. 가져올 요소들은 주어진 요소와 소유권 관계에서 연결되어 있으며 filterbits에 의해 정의된 기준과 일치합니다. (ACAPI_Element_Filter의 표에서 설명하는 filterbits flag 값들을 보십시오)

이용 가능한 연결:

소유자 요소의 타입 (guid로 지정됨) 연결된 요소 타입 (connectedElemTypeID)
API_WallID API_WindowID
API_WallID API_DoorID
API_RoofID API_SkylightID
API_ShellID API_SkylightID

주어진 벽 요소의 창 및 문들은 ACAPI_Element_GetMemo 함수로도 가져올 수 있습니다. (API_ElementMemowallWindows, wallDoors 멤버들)

 

예제

// Shell 요소들의 Skylights를 나열함

GS::Array<API_Guid> shells;
GSErrCode err = ACAPI_Element_GetElemList (API_ShellID, &shells);
if (err == NoError) {
    GS::UniString reportString;
    for (GS::Array<API_Guid>::ConstIterator it = shells.Enumerate (); it != NULL; ++it) {
        API_Guid shellGuid = *it;
        GS::UniString shellGuidString = APIGuid2GSGuid (shellGuid).ToUniString ();
        GS::Array<API_Guid> skylights;
        err = ACAPI_Element_GetConnectedElements (shellGuid, API_SkylightID, &skylights);
        if (err == NoError) {
            if (skylights.IsEmpty ()) {
                reportString = GS::UniString::Printf ("Shell {%T} has no Skylights", shellGuidString.ToPrintf ());
            } else {
                reportString = GS::UniString::Printf ("Skylights in Shell {%T}:", shellGuidString.ToPrintf ());
                for (UIndex i = 0; i < skylights.GetSize (); i++) {
                    API_Element element;
                    BNZeroMemory (&element, sizeof (API_Element));
                    element.header.guid = skylights[i];
                    if (ACAPI_Element_Get (&element) == NoError) {
                        API_LibPart libPart;
                        BNZeroMemory (&libPart, sizeof (API_LibPart));
                        libPart.index = element.skylight.openingBase.libInd;
                        if (ACAPI_LibPart_Get (&libPart) == NoError) {
                            reportString.Append (" \"");
                            reportString.Append (libPart.docu_UName);
                            reportString.Append ("\"");
                        }
                        delete libPart.location;
                    }
                }
            }
        } else {
            reportString = GS::UniString::Printf ("Failed to get Skylights for Shell {%T}", shellGuidString.ToPrintf ());
        }
        ACAPI_WriteReport (reportString.ToCStr ().Get (), false);
    }
}

 

요구사항

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

 

참고사항

ACAPI_Element_Filter, ACAPI_Element_GetElemList, ACAPI_Element_GetMemo
요소 관리자, API 함수