<?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: Get Materials of Multi-layer components from current selected Wall in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364452#M1288</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;	API_Element					element = {};
	API_ModelElemStructureType	structtype = {};
	API_AttributeIndex			constrinx = {};
	double						fillThick = 0;
	BNZeroMemory(&amp;amp;element, sizeof(API_Element));
	element.header.guid = elemGuid;
	err = ACAPI_Element_Get(&amp;amp;element);
	if (err != NoError) {return err;}
structtype = element.wall.modelElemStructureType;
		if (structtype == API_CompositeStructure) constrinx = element.wall.composite;
		if (structtype == API_BasicStructure) constrinx = element.wall.buildingMaterial;
		fillThick = element.wall.thickness;
API_Attribute						attrib;
		API_AttributeDef					defs;
		BNZeroMemory(&amp;amp;attrib, sizeof(API_Attribute));
		BNZeroMemory(&amp;amp;defs, sizeof(API_AttributeDef));
		attrib.header.typeID = API_CompWallID;
		attrib.header.index = constrinx;
		err = ACAPI_Attribute_Get(&amp;amp;attrib);
		if (err != NoError) {return err;}
		err = ACAPI_Attribute_GetDef(attrib.header.typeID, attrib.header.index, &amp;amp;defs);
		if (err != NoError) {return err;}
		for (short i = 0; i &amp;lt; attrib.compWall.nComps; i++) {
			/// you code for (*defs.cwall_compItems)[i].buildingMaterial, (*defs.cwall_compItems)[i].fillThick
		}
		ACAPI_DisposeAttrDefsHdls(&amp;amp;defs);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 10:55:07 GMT</pubDate>
    <dc:creator>kuvbur</dc:creator>
    <dc:date>2022-12-08T10:55:07Z</dc:date>
    <item>
      <title>Get Materials of Multi-layer components from current selected Wall</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364314#M1287</link>
      <description>&lt;P&gt;I want to extract the materials of a wall I have currently selected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only know that I get the selected elements with this code (i guess)&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;GS::Array&amp;lt;API_Neig&amp;gt; walls;

GSErrCode err = ACAPI_Selection_Get(nullptr, &amp;amp;walls, false, true, API_InsidePartially);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/55795i69023B96E32D92BB/image-size/large?v=v2&amp;amp;px=999" border="0" alt="image.png" title="image.png" /&gt;</description>
      <pubDate>Wed, 07 Dec 2022 18:59:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364314#M1287</guid>
      <dc:creator>mcbabo</dc:creator>
      <dc:date>2022-12-07T18:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get Materials of Multi-layer components from current selected Wall</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364452#M1288</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;	API_Element					element = {};
	API_ModelElemStructureType	structtype = {};
	API_AttributeIndex			constrinx = {};
	double						fillThick = 0;
	BNZeroMemory(&amp;amp;element, sizeof(API_Element));
	element.header.guid = elemGuid;
	err = ACAPI_Element_Get(&amp;amp;element);
	if (err != NoError) {return err;}
structtype = element.wall.modelElemStructureType;
		if (structtype == API_CompositeStructure) constrinx = element.wall.composite;
		if (structtype == API_BasicStructure) constrinx = element.wall.buildingMaterial;
		fillThick = element.wall.thickness;
API_Attribute						attrib;
		API_AttributeDef					defs;
		BNZeroMemory(&amp;amp;attrib, sizeof(API_Attribute));
		BNZeroMemory(&amp;amp;defs, sizeof(API_AttributeDef));
		attrib.header.typeID = API_CompWallID;
		attrib.header.index = constrinx;
		err = ACAPI_Attribute_Get(&amp;amp;attrib);
		if (err != NoError) {return err;}
		err = ACAPI_Attribute_GetDef(attrib.header.typeID, attrib.header.index, &amp;amp;defs);
		if (err != NoError) {return err;}
		for (short i = 0; i &amp;lt; attrib.compWall.nComps; i++) {
			/// you code for (*defs.cwall_compItems)[i].buildingMaterial, (*defs.cwall_compItems)[i].fillThick
		}
		ACAPI_DisposeAttrDefsHdls(&amp;amp;defs);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 10:55:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364452#M1288</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2022-12-08T10:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get Materials of Multi-layer components from current selected Wall</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364456#M1289</link>
      <description>&lt;P&gt;Thanks for your code, but could you please explain the functions of every line. I am very new to the API, so I don't understand all of it.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 11:55:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Get-Materials-of-Multi-layer-components-from-current-selected/m-p/364456#M1289</guid>
      <dc:creator>mcbabo</dc:creator>
      <dc:date>2022-12-08T11:55:51Z</dc:date>
    </item>
  </channel>
</rss>

