Graphisoft®

API Development KitVersion: 18

ACAPI_Element_GetRelations

벽, 보, 룸들에 연결된 객체들의 정보를 리턴합니다.

    GSErrCode  ACAPI_Element_GetRelations (
        const API_Guid&     guid,
        API_ElemTypeID      otherID,
        void*               relData
    );

 

파라미터

guid 12
[in] 요소의 guid입니다.
otherID
[in] 요청된 요소 타입의 ID입니다.
relData
[out] 함수에 의해 리턴된 관계 데이터입니다. 이 포인터는 typeID 파라미터에 따라 API_WallRelation, API_BeamRelation, API_RoomRelation, API_RoofRelation, API_ShellRelation, API_SkylightRelation, 또는 API_CWPanelRelation structure를 참조합니다.

 

리턴 값

NoError
동작이 성공적입니다.
APIERR_BADPARS
relData 파라미터가 NULL입니다.
APIERR_BADID
올바르지 않은 guid가 지정되었습니다.
APIERR_DELETED
요소가 데이터베이스에 존재하지 않습니다.

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

 

설명

이 함수는 벽, 보, 커튼월 패널, 스카이라이트, 지붕, 셸 및 룸에 연결된 요소들에 대한 정보를 리턴합니다. 요청된 객체 타입이 otherID에 주어집니다. 룸의 경우 벽, 기둥, 보,객체, 창, 문, 램프, 커튼월, 지붕, 셸 및 스카이라이트가 리턴됩니다. 이 경우 otherIDAPI_ZombieElemID, API_WallID, API_ColumnID, API_BeamID, API_ObjectID, API_LampID, API_WindowID API_DoorID, API_LampD, API_CurtainWallID, API_CurtainWallSegmentID API_CurtainWallFrameID, API_CurtainWallPanelID API_CurtainWallJunctionID, API_CurtainWallAccessoryID API_RoofID, API_ShellID 또는 API_SkylightID일 수 있습니다. 벽과 보의 경우, 리턴된 정보에는 룸 내에 있는 벽의 해당 세그먼트가 포함되어 있습니다. (API_WallPartAPI_BeamPart를 보십시오)

벽의 경우 연결된 요소와 수정된 폴리곤이 relData에 들어갑니다; otherIDAPI_ZombieElemID, 또는 API_WallID일 수 있습니다. 양수 인덱스들은 다른 객체의 시작점이 벽에 연결되어 있음을 의미합니다; 음수 인덱스들은 끝점을 의미합니다. 5가지 타입의 연결이 리턴됩니다: 시작점에 연결된 벽, 끝점에 연결된 벽, 벽의 레퍼런스 라인과 연결된 벽, 요청한 벽이 연결된 레퍼런스 라인에 대한 벽, 교차 연결된 벽.

보의 경우 연결된 요소와 수정된 폴리곤이 relData에 들어갑니다; otherIDAPI_ZombieElemID, 또는 API_BeamID일 수 있습니다. 양수 인덱스들은 다른 객체의 시작점이 보에 연결되어 있음을 의미합니다; 음수 인덱스들은 끝점을 의미합니다. 5가지 타입의 연결이 리턴됩니다: 시작점에 연결된 보, 끝점에 연결된 보, 보의 레퍼런스 라인과 연결된 보, 요청한 보가 연결된 레퍼런스 라인에 대한 보, 교차 연결된 보.

커튼월 패널의 경우 연결된 룸이 relData에 들어가고, otherIDAPI_ZombieElemID, 또는 API_ZoneID일 수 있습니다. Featuring API 12

지붕과 셸의 경우 연결된 룸이 rooms에 들어가고, otherIDAPI_ZombieElemID, 또는 API_ZoneID가 될 수 있습니다. Featuring API 15

적절한 ACAPI_DisposeRoomRelationHdls, ACAPI_DisposeWallRelationHdls, 또는 ACAPI_DisposeBeamRelationHdls 함수를 호출하여 핸들을 폐기하는 것을 잊지 마십시오.

 

예제


API_WallRelation        relData;
Int32                   ind;
char                    msgStr[256], numStr[32];
GS::Array<API_Guid>     elemList;

ACAPI_Element_GetElemList (API_WallID, &wallList);
for (GS::Array<API_Guid>::ConstIterator it = wallList.Enumerate (); it != NULL; ++it) {

    if (ACAPI_Element_GetRelations (*it, API_WallID, (void*) &relData) != NoError)
        continue;

    sprintf (msgStr, "Connected walls to the wall #%ld", APIGuidToString (*it).ToCStr ().Get ());
    ACAPI_WriteReport (msgStr, false);

    if (relData->conBeg != NULL) {
        sprintf (msgStr, "    at the begin point:");
        for (ind = 0; ind < relData->nConBeg; ind ++) {
            sprintf (numStr, " #%ld", (*(relData->conBeg)) [ind]);
            strcat (msgStr, numStr);
        }
    }

    if (relData->conEnd != NULL) {
        sprintf (msgStr, "    at the end point:");
        for (ind = 0; ind < relData->nConEnd; ind ++) {
            sprintf (numStr, " #%ld", (*(relData->conEnd)) [ind]);
            strcat (msgStr, numStr);
        }
    }

    if (relData->conRef != NULL) {
        sprintf (msgStr, "    on the reference line not at the end points:");
        for (ind = 0; ind < relData->nConRef; ind ++) {
            sprintf (numStr, " #%ld", (*(relData->conRef)) [ind]);
            strcat (msgStr, numStr);
        }
    }

    if (relData->con != NULL) {
        sprintf (msgStr, "    on the reference line:");
        for (ind = 0; ind < relData->nCon; ind ++) {
            sprintf (numStr, " #%ld", (*(relData->con)) [ind]);
            strcat (msgStr, numStr);
        }

    if (relData->conX != NULL) {
        sprintf (msgStr, "    having intersection with:");
        for (ind = 0; ind < relData->nConX; ind ++) {
            sprintf (numStr, " #%ld", (*(relData->conX)) [ind]);
            strcat (msgStr, numStr);
        }
    }

    ACAPI_DisposeWallRelationHdls (&relData);
}

 

요구사항

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

 

참고사항

API_Guid, API_ElemTypeID, API_WallRelation, API_BeamRelation, API_RoomRelation, API_CWPanelRelation, API_SkylightRelation, API_ShellRelation, API_RoofRelation, API_WallPart, API_BeamPart, API_Niche,
ACAPI_DisposeRoomRelationHdls, ACAPI_DisposeWallRelationHdls, ACAPI_DisposeBeamRelationHdls,
요소 관계, 요소 관리자, API 함수