We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-07-19 09:02 AM - last edited on 2021-09-14 09:26 AM by Noemi Balogh
long Get3DInfo (const API_Guid& guid) { DBASSERT (APINULLGuid != guid); m_Guid = guid; BNZeroMemory (&m_info3D, sizeof (API_ElemInfo3D)); API_Elem_Head elemHead; BNZeroMemory (&elemHead, sizeof (API_Elem_Head)); elemHead.guid = m_Guid; ACAPI_Element_GetHeader (&elemHead); m_err = ACAPI_Element_Get3DInfo (elemHead, &m_info3D); if (m_err == APIERR_BADID) return 0; if (m_err == APIERR_GENERAL) return 0; if (m_err != NoError) { ErrorBeep ("Error in ACAPI_Element_Get3DInfo", m_err); return 0; } m_nBody = m_info3D.lbody - m_info3D.fbody + 1; if (m_nBody > 0) GetBody (m_info3D.fbody); return m_nBody; } bool GetBody (long bodyIndex) { DBASSERT (APINULLGuid != m_Guid); DBASSERT (bodyIndex > 0); DBASSERT (bodyIndex >= m_info3D.fbody && bodyIndex <= m_info3D.lbody); BNZeroMemory (&m_component, sizeof (API_Component3D)); m_component.header.typeID = API_BodyID; m_component.header.index = bodyIndex; m_err = ACAPI_3D_GetComponent (&m_component); // ACAPI_3D_GetComponent return APIERR_DELETED in Archicad24 if (m_err == APIERR_DELETED) m_err = NoError; if (m_err != NoError) { ErrorBeep ("Error in ACAPI_Element_Get3DInfo", m_err); return false; } return true; }
Solved! Go to Solution.
2021-07-19 09:26 AM
for (int i = 0; i < BMpGetSize((GSPtr)(memo.columnSegments)) / sizeof(API_ColumnSegmentType); i++) { Get3DInfo(memo.columnSegments.head.guid); }
2021-07-19 09:26 AM
for (int i = 0; i < BMpGetSize((GSPtr)(memo.columnSegments)) / sizeof(API_ColumnSegmentType); i++) { Get3DInfo(memo.columnSegments.head.guid); }
2021-07-19 11:03 AM
leilei wrote:Thank you. It works!
Hi,Maybe the element is column、beam.When you get the guids of beams and columns.You should traverse the sub elements in memo.columnSegments or memo.beamSegments.for (int i = 0; i < BMpGetSize((GSPtr)(memo.columnSegments)) / sizeof(API_ColumnSegmentType); i++) { Get3DInfo(memo.columnSegments.head.guid); }