<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem using ACAPI_3D_GetComponent in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285868#M2192</link>
    <description>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.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;for (int i = 0; i &amp;lt; BMpGetSize((GSPtr)(memo.columnSegments)) / sizeof(API_ColumnSegmentType); i++)
{
Get3DInfo(memo.columnSegments&lt;I&gt;.head.guid);
}
&lt;/I&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Jul 2021 07:26:19 GMT</pubDate>
    <dc:creator>leilei</dc:creator>
    <dc:date>2021-07-19T07:26:19Z</dc:date>
    <item>
      <title>Problem using ACAPI_3D_GetComponent</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285867#M2191</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;There is a problem using ACAPI_3D_GetComponent.&lt;BR /&gt;&lt;BR /&gt;I am updating from Archicad22 to Archicad24 and it returns an error code of APIERR_DELETED.&lt;BR /&gt;&lt;BR /&gt;It returns NoError when checked with the same code in Archicad22.&lt;BR /&gt;&lt;BR /&gt;I checked that ACAPI_Element_Get3DInfo returns NoError, so it seems that the element exists in the 3D database.&lt;BR /&gt;&lt;BR /&gt;And I can see the element in Archicad 3D view.&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;long Get3DInfo (const API_Guid&amp;amp; guid) {
	DBASSERT (APINULLGuid != guid);
	m_Guid = guid;
	BNZeroMemory (&amp;amp;m_info3D, sizeof (API_ElemInfo3D));

	API_Elem_Head elemHead;
	BNZeroMemory (&amp;amp;elemHead, sizeof (API_Elem_Head));
	elemHead.guid = m_Guid;

	ACAPI_Element_GetHeader (&amp;amp;elemHead);
	m_err = ACAPI_Element_Get3DInfo (elemHead, &amp;amp;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 &amp;gt; 0) GetBody (m_info3D.fbody);

	return m_nBody;
}

bool GetBody (long bodyIndex)
{
	DBASSERT (APINULLGuid != m_Guid);
	DBASSERT (bodyIndex &amp;gt; 0);
	DBASSERT (bodyIndex &amp;gt;= m_info3D.fbody &amp;amp;&amp;amp; bodyIndex &amp;lt;= m_info3D.lbody);

	BNZeroMemory (&amp;amp;m_component, sizeof (API_Component3D));
	m_component.header.typeID = API_BodyID;
	m_component.header.index  = bodyIndex;
	m_err = ACAPI_3D_GetComponent (&amp;amp;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;
}
&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:26:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285867#M2191</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T07:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using ACAPI_3D_GetComponent</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285868#M2192</link>
      <description>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.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;for (int i = 0; i &amp;lt; BMpGetSize((GSPtr)(memo.columnSegments)) / sizeof(API_ColumnSegmentType); i++)
{
Get3DInfo(memo.columnSegments&lt;I&gt;.head.guid);
}
&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Jul 2021 07:26:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285868#M2192</guid>
      <dc:creator>leilei</dc:creator>
      <dc:date>2021-07-19T07:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using ACAPI_3D_GetComponent</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285869#M2193</link>
      <description>&lt;BLOCKQUOTE&gt;leilei wrote:&lt;BR /&gt;
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.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;for (int i = 0; i &amp;lt; BMpGetSize((GSPtr)(memo.columnSegments)) / sizeof(API_ColumnSegmentType); i++)
{
Get3DInfo(memo.columnSegments&lt;I&gt;.head.guid);
}
&lt;/I&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

Thank you. It works!</description>
      <pubDate>Mon, 19 Jul 2021 09:03:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-using-ACAPI-3D-GetComponent/m-p/285869#M2193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-19T09:03:15Z</dc:date>
    </item>
  </channel>
</rss>

