Archicad二次开发——创建辅助元素

1、创建线

API_Element element;
BNZeroMemory(&element, sizeof(API_Element));

element.header.typeID = API_LineID;
GSErrCode err = ACAPI_Element_GetDefaults(&element, nullptr);
if (err != NoError) {
	ErrorBeep("ACAPI_Element_GetDefaults (Line)", err);
	return Error;
}

element.line.begC = { 0,0 };
element.line.endC = { 10,10 };
element.line.linePen.penIndex = 3;
err = ACAPI_CallUndoableCommand("Create Element", [&]() -> GSErrCode {
					return ACAPI_Element_Create(&element, nullptr);
				});

			}

 

你可能感兴趣的:(Archicad二次开发)