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.

Can't get Column element

WalterWhite
Participant

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?

 

 

1 REPLY 1
Mihaly Palenik
Graphisoft
Graphisoft

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.