<?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: How can I get area and volume of element components in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662845#M10361</link>
    <description>&lt;P&gt;Hm... you probably need to allocate the &lt;EM&gt;composites&lt;/EM&gt; member first, like you did for the &lt;EM&gt;elements&lt;/EM&gt; member.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_Quantities quantities;
API_ElementQuantity quantity{};
quantities.elements = &amp;amp;quantity;
GS::Array&amp;lt;API_CompositeQuantity&amp;gt; compositeQuantities{};
quantities.composites = &amp;amp;compositeQuantities;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 May 2025 10:04:44 GMT</pubDate>
    <dc:creator>BerndSchwarzenbacher</dc:creator>
    <dc:date>2025-05-19T10:04:44Z</dc:date>
    <item>
      <title>How can I get area and volume of element components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662722#M10354</link>
      <description>&lt;P&gt;I have a generic wall with default parameters. When I open the All Components Schedule there is a list of all components of this wall. How can I get the area and the volume as displayed in the screenshot? Didn't find any sample code in the examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kolioi_2-1747397132722.png" style="width: 800px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/86971i3D3A4534F0DE5DEF/image-dimensions/800x429?v=v2" width="800" height="429" role="button" title="kolioi_2-1747397132722.png" alt="kolioi_2-1747397132722.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 08:50:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662722#M10354</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2025-05-19T08:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get parameters of components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662733#M10355</link>
      <description>&lt;P&gt;Hi Kolioi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can get these values via &lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#gafd5933e2ae717d86cd036d1fc41134d9" target="_blank"&gt;ACAPI_Element_GetQuantities&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The composites member of the &lt;A href="https://graphisoft.github.io/archicad-api-devkit/class_a_p_i___quantities.html" target="_self"&gt;API_Quantities&lt;/A&gt; object should have exactly those values you are looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 14:37:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662733#M10355</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2025-05-16T14:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get parameters of components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662830#M10358</link>
      <description>&lt;P&gt;Hi Bernd,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works for elements but not for their components.&lt;BR /&gt;&lt;BR /&gt;In the above example I have a composite wall with 2 skins&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kolioi_0-1747643245250.png" style="width: 719px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/86989iF9D1458F0CC12A20/image-dimensions/719x472?v=v2" width="719" height="472" role="button" title="kolioi_0-1747643245250.png" alt="kolioi_0-1747643245250.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GS::Array&amp;lt;API_Guid&amp;gt; elemList;
GS::GSErrCode err = ACAPI_Element_GetElemList(API_WallID, &amp;amp;elemList, APIFilt_In3D);
for (USize i = 0; i &amp;lt; elemList.GetSize(); i++) {
	API_Element element{};
	element.header.guid = elemList.Get(i);
	err = ACAPI_Element_Get(&amp;amp;element);
	if (!err) {
			GS::Array&amp;lt;API_ElemComponentID&amp;gt; elemComponents;
			err = ACAPI_Element_GetComponents(element.header.guid, elemComponents);
			for (const auto&amp;amp; comp : elemComponents) {
				API_QuantityPar params;
				API_Quantities quantities;
				API_QuantitiesMask mask;
				API_ElementQuantity quantity{};

				quantities.elements = &amp;amp;quantity;

				ACAPI_ELEMENT_QUANTITY_MASK_SETFULL(mask);
				ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);

				err = ACAPI_Element_GetQuantities(comp.componentID.componentGuid, &amp;amp;params, &amp;amp;quantities, &amp;amp;mask);

				ACAPI_ELEMENT_QUANTITIES_MASK_CLEAR(mask);
				ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_CLEAR(mask);
			}

	}
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;and&amp;nbsp;ACAPI_Element_GetQuantities() returns&amp;nbsp;&lt;SPAN&gt;APIERR_BADID (Incorrect elemGuid was specified / The passed identifier is not a valid one, or valid, but not proper for the given operation). If I pass the wall guid, the function returns correct values for the wall. However, I want to obtain the area and volume of the wall skins.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:13:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662830#M10358</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2025-05-19T10:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get area and volume of element components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662833#M10359</link>
      <description>&lt;P&gt;I was thinking about getting the quantities for the element wall and then checking quantities-&amp;gt;composites.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BerndSchwarzenbacher_0-1747644779442.png" style="width: 720px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/86991iB9C1DC08C85C61A4/image-dimensions/720x309?v=v2" width="720" height="309" role="button" title="BerndSchwarzenbacher_0-1747644779442.png" alt="BerndSchwarzenbacher_0-1747644779442.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try this too?&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:14:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662833#M10359</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2025-05-19T10:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get area and volume of element components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662836#M10360</link>
      <description>&lt;P&gt;It's NULL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kolioi_0-1747645927826.png" style="width: 719px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/86992i979829111587852A/image-dimensions/719x209?v=v2" width="719" height="209" role="button" title="kolioi_0-1747645927826.png" alt="kolioi_0-1747645927826.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:15:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662836#M10360</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2025-05-19T10:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get area and volume of element components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662845#M10361</link>
      <description>&lt;P&gt;Hm... you probably need to allocate the &lt;EM&gt;composites&lt;/EM&gt; member first, like you did for the &lt;EM&gt;elements&lt;/EM&gt; member.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_Quantities quantities;
API_ElementQuantity quantity{};
quantities.elements = &amp;amp;quantity;
GS::Array&amp;lt;API_CompositeQuantity&amp;gt; compositeQuantities{};
quantities.composites = &amp;amp;compositeQuantities;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:04:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662845#M10361</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2025-05-19T10:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get area and volume of element components</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662852#M10362</link>
      <description>&lt;P&gt;OK, I found it in the examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Element_Test,&amp;nbsp;Element_Snippets.cpp,&amp;nbsp;Do_CalcQuantities()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:38:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-area-and-volume-of-element-components/m-p/662852#M10362</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2025-05-19T10:38:48Z</dc:date>
    </item>
  </channel>
</rss>

