We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-06-21 02:50 PM - last edited on 2021-09-14 09:32 AM by Noemi Balogh
API_Region clipRegion; BNZeroMemory(&clipRegion, sizeof(API_Region)); clipRegion.box.xMin = 0.0; clipRegion.box.xMax = .2; clipRegion.box.yMin = 0.0; clipRegion.box.yMax = .1; err = ACAPI_Database(APIDb_StartClippingSessionID, nullptr, nullptr); if (err == NoError) { API_Element element; BNZeroMemory(&element, sizeof(API_Element)); element.header.typeID = API_DrawingID; err = ACAPI_Element_GetDefaults(&element, nullptr); if (err != NoError) { return err; } //here the Selectedguid array holds the ViewNavigator Item guid element.drawing.drawingGuid = Selectedguid[0]; element.drawing.anchorPoint = APIAnc_LB; element.drawing.pos.x = 0.05; element.drawing.pos.y = 0.05; err = ACAPI_CallUndoableCommand("crate new from last drawing", [&]()->GSErrCode { err = ACAPI_Element_Create(&element, nullptr); err = ACAPI_Database(APIDb_DoClipID, &clipRegion, nullptr); err = ACAPI_Database(APIDb_StopClippingSessionID, nullptr, nullptr); return err; });But it's not working. On "ACAPI_Database(APIDb_DoClipID, &clipRegion, nullptr)" method getting error code "-2130313215" that refers to the "General error code".