2021-03-23
12:38 PM
- last edited on
2021-09-14
09:51 AM
by
Noemi Balogh
API_StoryInfo storyInfo;
BNZeroMemory(&storyInfo, sizeof(API_StoryInfo));
GSErrCode err = ACAPI_Environment(APIEnv_GetStorySettingsID, &storyInfo, nullptr);
API_StoryType** storyType= storyInfo.data;
API_StoryType* temAdress = (*storyType);
//删除楼层
for (int i=storyInfo.firstStory;i<= storyInfo.lastStory; i++)
{
API_StoryCmdType changeType;
BNZeroMemory(&changeType, sizeof(API_StoryCmdType));
changeType.action = APIStory_Delete;
changeType.index = temAdress->index;
changeType.dispOnSections = true;
changeType.dontRebuild = true;
changeType.elevation = temAdress->level;
//changeType.uName = temAdress->uName;
err= ACAPI_Environment(APIEnv_ChangeStorySettingsID, &changeType, nullptr);
temAdress++;
};
I try to delete story by the code above ,but it didn‘t work , and the error code was "APIERR_REFUSEDCMD -2130312312 81060388 The passed identifier is not subject to the operation. ".I can not find why.2021-03-24 05:41 PM
ACAPI_CallUndoableCommand ("Delete Story", [&] () -> GSErrCode {
// call APIEnv_ChangeStorySettingsID here
});
It's your choice if you create a separate undo step for all stories, or to do the whole modification in one undo step.