cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

APIERR_GENERAL Error in ACAPI_Element_Create

Anonymous
Not applicable
Hi.

I have some problem when I try to creating curtain wall.

There is a curtain wall already created in archicad. (not using api)

I get the curtain wall and try to create it in other layer, but ACAPI_Element_Create return APIERR_GENERAL.

After get the curtain wall, I just change header.layer.

API_Element element;
API_ElementMemo memo;
BNZeroMemory(&element, sizeof(API_Element));
BNZeroMemory(&memo, sizeof(API_ElementMemo));
element.header.guid = oriElemList[idx];
err = ACAPI_Element_Get(&element);

if (element.header.hasMemo == true)
err = ACAPI_Element_GetMemo(element.header.guid, &memo);

API_Attribute attrib;
BNZeroMemory(&attrib, sizeof(API_Attribute));
attrib.header.typeID = API_LayerID;
CHCopyC(trade.ToCStr(), attrib.header.name);
err = ACAPI_Attribute_Search(&attrib.header);
element.header.layer = attrib.header.index;
err = ACAPI_Element_Create(&element, &memo);

err is GSErrCode
oriElemList is GS::Array<API_Guid>
trade is GS::UniString

Is there anything that I have to do more?
0 REPLIES 0