<?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: Extract wall composite name with API (AC26) in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583532#M9068</link>
    <description>&lt;P&gt;Happy New year&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/69351"&gt;@YourQS&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/46313"&gt;@Joel Buehler&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Please I need help. I am new to App Development using Archicad C++ API. I am trying to extract some basic information from the AC Database and specific Elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, I have tried to extract some Building Material Attribute information, particularly the ID, Manufacturer, and Description, but my code always returns empty. Please, I need help. I've attached the information I need and the snippet of the line of code I have been using.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;API_Attribute attrib = {};
	GSErrCode err;

	BNZeroMemory(&amp;amp;attrib, sizeof(API_Attribute));
	attrib.header.typeID = API_BuildingMaterialID;
	attrib.header.index = 4;

	err = ACAPI_Attribute_Get(&amp;amp;attrib);
	if (err == NoError) {

		 /*Extracting GS::UniString values*/
		const GS::UniString theGuid = APIGuid2GSGuid(attrib.buildingMaterial.head.guid).ToUniString().ToCStr().Get();

		const GS::UniString idString = attrib.buildingMaterial.id ?
			GS::UniString(*attrib.buildingMaterial.id).ToCStr().Get() : GS::UniString();

		const GS::UniString manufacturerString = attrib.buildingMaterial.manufacturer ? 
			GS::UniString(*attrib.buildingMaterial.manufacturer).ToCStr().Get() : GS::UniString();

		const GS::UniString descriptionString = attrib.buildingMaterial.description ? 
			GS::UniString(*attrib.buildingMaterial.description).ToCStr().Get() : GS::UniString();
		
		 /*Displaying extracted values*/
		ACAPI_WriteReport("Building Material Information:\nGuid: " + theGuid + 
			"\nID: " + idString + "\nManufacturer: " + manufacturerString + 
			"\nDescription: " + descriptionString, true);&lt;/LI-CODE&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/57216i266335A719691AB6/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Archicad api request.png" title="Archicad api request.png" /&gt;</description>
    <pubDate>Thu, 11 Jan 2024 10:24:08 GMT</pubDate>
    <dc:creator>Apollos</dc:creator>
    <dc:date>2024-01-11T10:24:08Z</dc:date>
    <item>
      <title>Extract wall composite name with API (AC26)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/399206#M8609</link>
      <description>&lt;P&gt;I would like to extract the composite name from walls, slabs, and roofs using the API.&amp;nbsp; &amp;nbsp;I have got all the other information I need (dimensions, instance name, etc) but I am struggling to find where to get composite info.&amp;nbsp; &amp;nbsp;I have attached 2 screenshots showing what I need to get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could someone point me to where this value is held?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&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="WallFill.PNG" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46334i805D43862A5FF2B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="WallFill.PNG" alt="WallFill.PNG" /&gt;&lt;/span&gt; &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="SlabFill.PNG" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46335iC8B2771EE6377C49/image-size/large?v=v2&amp;amp;px=999" role="button" title="SlabFill.PNG" alt="SlabFill.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 11:16:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/399206#M8609</guid>
      <dc:creator>YourQS</dc:creator>
      <dc:date>2024-09-17T11:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extract wall composite name with API (AC26)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/399259#M8611</link>
      <description>&lt;P&gt;The Composite is in element specific structs&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoelBuehler_0-1695374614967.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46159iF95A6DB7F1541B11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoelBuehler_0-1695374614967.png" alt="JoelBuehler_0-1695374614967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is a example of the wall:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://archicadapi.graphisoft.com/documentation/api_walltype?s=API_WallType" target="_blank" rel="noopener"&gt;https://archicadapi.graphisoft.com/documentation/api_walltype?s=API_WallType&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you get the Attribute Index and with ACAPI_Attribute_Get you should be able to mangle to the name of the composite&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 09:28:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/399259#M8611</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2023-09-22T09:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extract wall composite name with API (AC26)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/399439#M8612</link>
      <description>&lt;P&gt;Thanks very much&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2023 18:44:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/399439#M8612</guid>
      <dc:creator>YourQS</dc:creator>
      <dc:date>2023-09-24T18:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract wall composite name with API (AC26)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583532#M9068</link>
      <description>&lt;P&gt;Happy New year&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/69351"&gt;@YourQS&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/46313"&gt;@Joel Buehler&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Please I need help. I am new to App Development using Archicad C++ API. I am trying to extract some basic information from the AC Database and specific Elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, I have tried to extract some Building Material Attribute information, particularly the ID, Manufacturer, and Description, but my code always returns empty. Please, I need help. I've attached the information I need and the snippet of the line of code I have been using.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;API_Attribute attrib = {};
	GSErrCode err;

	BNZeroMemory(&amp;amp;attrib, sizeof(API_Attribute));
	attrib.header.typeID = API_BuildingMaterialID;
	attrib.header.index = 4;

	err = ACAPI_Attribute_Get(&amp;amp;attrib);
	if (err == NoError) {

		 /*Extracting GS::UniString values*/
		const GS::UniString theGuid = APIGuid2GSGuid(attrib.buildingMaterial.head.guid).ToUniString().ToCStr().Get();

		const GS::UniString idString = attrib.buildingMaterial.id ?
			GS::UniString(*attrib.buildingMaterial.id).ToCStr().Get() : GS::UniString();

		const GS::UniString manufacturerString = attrib.buildingMaterial.manufacturer ? 
			GS::UniString(*attrib.buildingMaterial.manufacturer).ToCStr().Get() : GS::UniString();

		const GS::UniString descriptionString = attrib.buildingMaterial.description ? 
			GS::UniString(*attrib.buildingMaterial.description).ToCStr().Get() : GS::UniString();
		
		 /*Displaying extracted values*/
		ACAPI_WriteReport("Building Material Information:\nGuid: " + theGuid + 
			"\nID: " + idString + "\nManufacturer: " + manufacturerString + 
			"\nDescription: " + descriptionString, true);&lt;/LI-CODE&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/57216i266335A719691AB6/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Archicad api request.png" title="Archicad api request.png" /&gt;</description>
      <pubDate>Thu, 11 Jan 2024 10:24:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583532#M9068</guid>
      <dc:creator>Apollos</dc:creator>
      <dc:date>2024-01-11T10:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Extract wall composite name with API (AC26)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583618#M9073</link>
      <description>&lt;P&gt;Hi Appolos,&lt;/P&gt;&lt;P&gt;Where do you get the index from in the line&amp;nbsp;&lt;/P&gt;&lt;P&gt;attrib.header.index = 4&lt;/P&gt;&lt;P&gt;Magic numbers like this are generally frowned upon, because others don't know what they mean.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 20:56:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583618#M9073</guid>
      <dc:creator>YourQS</dc:creator>
      <dc:date>2024-01-11T20:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract wall composite name with API (AC26)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583670#M9075</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/69351"&gt;@YourQS&lt;/a&gt;&amp;nbsp; thank you for your response.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pardon me for not adding comments to the line of code. NOTE: As I mentioned earlier I am new to using the Archicad C++ API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "attrib.header.index" specifies the index value of the attribute. I observed that in the Attribute Manager documentation (see the picture).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to extract the attributes of all the Building Materials within the Archicad Database (as is) therefore I thought iterating through the index was the best way.&lt;/P&gt;
&lt;P&gt;I got results (e.g. Guid, name, connPriority, cutFill, cutFillBackgroung, etc) but I could not access the ID and manufacturer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a better suggestion and advice I await your response.&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="attrib index pix.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/51927iEAC6BB33DB9A9BF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="attrib index pix.png" alt="attrib index pix.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 00:55:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Extract-wall-composite-name-with-API-AC26/m-p/583670#M9075</guid>
      <dc:creator>Apollos</dc:creator>
      <dc:date>2024-01-15T00:55:19Z</dc:date>
    </item>
  </channel>
</rss>

