Graphisoft®

API Development KitVersion: 18

APIEnv_UserWorkspaceID

팀워크 프로젝트의 클라이언트의 작업공간 데이터를 리턴합니다.

    GSErrCode ACAPI_Environment (
      APIEnv_UserWorkspaceID,
      API_WorkspaceInfo     *workspaceInfo,
      short                 *userID,
      NULL
    );

 

파라미터

workspaceInfo
입장했을 때 멤버에 대하여 할당된 작업공간 데이터입니다.
userID
팀 클라이언트의 멤버 ID입니다.

 

리턴 값

NoError
함수가 성공적으로 완료되었습니다.
APIERR_BADPARS
파라미터 중 1개 이상이 NULL입니다.
APIERR_NOPLAN
열린 프로젝트가 아닙니다.
APIERR_MEMFULL
메모리가 부족합니다.

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

 

설명

이 함수는 현재 클라이언트의 작업공간 정보를 가져오는 데 사용합니다. API 함수들이 데이터베이스에 접근하고 변경하는 부분이 사용자가 ArchiCAD의 UI로 할 수 있는 것과 동일하기 때문에, 이 정보는 매우 중요합니다.

예약된 층, 단면/입면, 레이어, 카메라 경로, 상세, 워크시트, 레이아웃 데이터베이스가 리턴됩니다. 이 함수는 클라이언트가 새로 생성한 프로젝트 구성요소들을 가져오지 않습니다. (은연중에 클라이언트의 작업공간에 추가됨) 그러나 팀 프로젝트로 아직 보내지 않습니다. (프로젝트 관리에 등록되지 않음)

더 이상 필요하지 않으면 내부 핸들들을 폐기하는 것을 잊지 마십시오.

 

예제

API_WorkspaceInfo      workspaceInfo;
API_StoryInfo          storyInfo;
Int32                  i, ind;
char                   buffer[256];
short                  userId = 0;

BNZeroMemory (&workspaceInfo, sizeof (API_WorkspaceInfo));
GSErrCode err = ACAPI_Environment (APIEnv_UserWorkspaceID, &workspaceInfo, &userId, NULL);
if (err == NoError) {
    ACAPI_WriteReport ("Stories:", false);
    if (workspaceInfo.nStories != 0) {
        BNZeroMemory (&storyInfo, sizeof (API_StoryInfo));
        ACAPI_Environment (APIEnv_GetStorySettingsID, &storyInfo, NULL, NULL);
        for (i = 0; i < workspaceInfo.nStories; i++) {
            ind = (*workspaceInfo.stories)[i];
            sprintf (buffer, "  [%3d] \"%s\"", ind, (*storyInfo.data)[ind - storyInfo.firstStory].name);
            ACAPI_WriteReport (buffer, false);
        }
        BMKillHandle ((GSHandle *) &storyInfo.data);
    }
}

BMKillHandle ((GSHandle *) &workspaceInfo.stories);
BMKillHandle ((GSHandle *) &workspaceInfo.layers);
BMKillHandle ((GSHandle *) &workspaceInfo.sections);
BMKillHandle ((GSHandle *) &workspaceInfo.camSets);
BMKillHandle ((GSHandle *) &workspaceInfo.details);
BMKillHandle ((GSHandle *) &workspaceInfo.worksheets);
BMKillHandle ((GSHandle *) &workspaceInfo.layouts);
BMKillHandle ((GSHandle *) &workspaceInfo.marquee.coords);

 

요구사항

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

 

참고사항

API_WorkspaceInfo
ACAPI_Environment, API 함수