2022-05-31 06:02 AM - edited 2022-05-31 07:56 AM
Hi there,
I use "ACAPI_Notify_CatchNewElement" to catch the modify of the element.
ACAPI_Notify_CatchNewElement(nullptr, ElementEventHandlerProc);
ACAPI_Notify_InstallElementObserver(ElementEventHandlerProc);
And I indeed can get the event.however, if I create an Column or Beam,I will get an elemHead which it's typeid is "API_ColumnID" but with an empty body.
GSErrCode __ACENV_CALL d5c_sync::ElementEventHandlerProc(const API_NotifyElementType * elem_type)
{
GSErrCode err = NoError;
if (err == NoError)
{
switch (elem_type->notifID)
{
// 新增
case APINotifyElement_New:
case APINotifyElement_Copy:
case APINotifyElement_Undo_Deleted:
case APINotifyElement_Redo_Created:
API_ElemInfo3D info3d;
BNZeroMemory(&info3d, sizeof(API_ElemInfo3D));
auto err = ACAPI_Element_Get3DInfo(elem_type->elemHead, &info3d);
break;
}
}
}
The question is that : When i create a Column, how can I get the real element with the geometry information?
2022-06-16 03:25 PM
Hello,
ACAPI_Element_Get3DInfo doesn't get any 3D information for columns and beams because they are hierarchical elements (works like container). You should get all segments (API_ColumnSegmentType/API_BeamSegmentType) of column/segment and get their 3D information.