Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Get elements inside drawing cropped view

ReignBough
Booster
I am trying to get all elements (specifically wall) from a drawing element. This drawing element is a view of a floor plan. Here is my initial code:

 

// change database
BNZeroMemory(&dbInfo, sizeof(API_DatabaseInfo));
dbInfo.typeID = APIWind_DrawingID;
dbInfo.linkedElement = i_drawingGuid;
err = ACAPI_Database(APIDb_ChangeCurrentDatabaseID, &dbInfo);

// get all elements on this database
GS::Array<API_Guid> guids = {};
ACAPI_Element_GetElemList(i_elemType, &guids, APIFilt_InCroppedView);
Int32 cnt = guids.GetSize();
for (Int32 i = 0; i < cnt; ++i)
{
    API_Element elem;
    BNZeroMemory(&elem, API_ElementSize);
    elem.header.guid = guids[i];
    ACAPI_Element_Get(&elem);
    DBGPrintlnf("%u ?= %u", i_elemType, elem.header.typeID);
}

 

ACAPI_Database returns APIERR_BADPARS. And I think it is the dbInfo.databaseUnId, since it is not set. What is the value that should be place here?
~ReignBough~
ARCHICAD 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS
0 REPLIES 0

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!