<?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 IFCAPI::PropertyAccessor::GetAttributes issue in custom add‑on in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/IFCAPI-PropertyAccessor-GetAttributes-issue-in-custom-add-on/m-p/710053#M10992</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does the new IFCAPI have any prerequisites that need to be set in order to be used? The code provided below, if added to the example project &lt;EM&gt;IFC_Test&lt;/EM&gt;, will print:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;PRE&gt;TestApi(): 1
TestApi(): 2
TestApi(): 3
Number of attributes: 6
Attribute Name0: GlobalId
Attribute Name0: Name
Attribute Name0: Tag
Attribute Name0: PredefinedType&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;However, the same code in my add‑on returns 0 attributes:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;TestApi(): 1&lt;BR /&gt;TestApi(): 2&lt;BR /&gt;TestApi(): 3&lt;BR /&gt;Number of attributes: 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Archicad version: 29.2.0 (5003)&lt;BR /&gt;SDK version: WIN.29.3100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Test function:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void TestApi()
{
	GS::Array&amp;lt;API_Neig&amp;gt; aSelection;
	API_SelectionInfo rSelectionInfo = {};
	ACAPI_Selection_Get(&amp;amp;rSelectionInfo, &amp;amp;aSelection, false);
	for (auto&amp;amp; rNeig : aSelection)
	{
		API_Elem_Head head{};
		head.guid = rNeig.guid;
		auto objectID = IFCAPI::GetObjectAccessor().CreateElementObjectID(head);
		//
		DBPrintf("TestApi(): 1\n");
		if (objectID.IsErr())
		{
			ACAPI_WriteReport("TestApi(): CreateElementObjectID failed for element ", true);
			return;
		}
		//
		IFCAPI::PropertyAccessor propertyAccessor = IFCAPI::PropertyAccessor(objectID.Unwrap());
		auto properties = propertyAccessor.GetAttributes();
		if (properties.IsErr())
		{
			ACAPI_WriteReport("TestApi(): GetAttributes failed for element", true);
			return;
		}
		DBPrintf("TestApi(): 2\n");
		//
		auto oIfcAttributes = properties.Unwrap();
		DBPrintf("TestApi(): 3\n");
		DBPrintf("Number of attributes: %zu\n", oIfcAttributes.size());
		//
		for (auto&amp;amp; rIfcAttribute : oIfcAttributes)
		{
			if (rIfcAttribute.GetName().IsEmpty()) continue;
			//
			if (!rIfcAttribute.GetValue().has_value()) continue;
			//
			DBPrintf("Attribute Name0: %s\n", rIfcAttribute.GetName().ToCStr().Get());
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 11 25H2&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jul 2026 13:30:27 GMT</pubDate>
    <dc:creator>larsr</dc:creator>
    <dc:date>2026-07-28T13:30:27Z</dc:date>
    <item>
      <title>IFCAPI::PropertyAccessor::GetAttributes issue in custom add‑on</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/IFCAPI-PropertyAccessor-GetAttributes-issue-in-custom-add-on/m-p/710053#M10992</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does the new IFCAPI have any prerequisites that need to be set in order to be used? The code provided below, if added to the example project &lt;EM&gt;IFC_Test&lt;/EM&gt;, will print:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;PRE&gt;TestApi(): 1
TestApi(): 2
TestApi(): 3
Number of attributes: 6
Attribute Name0: GlobalId
Attribute Name0: Name
Attribute Name0: Tag
Attribute Name0: PredefinedType&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;However, the same code in my add‑on returns 0 attributes:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;TestApi(): 1&lt;BR /&gt;TestApi(): 2&lt;BR /&gt;TestApi(): 3&lt;BR /&gt;Number of attributes: 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Archicad version: 29.2.0 (5003)&lt;BR /&gt;SDK version: WIN.29.3100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Test function:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void TestApi()
{
	GS::Array&amp;lt;API_Neig&amp;gt; aSelection;
	API_SelectionInfo rSelectionInfo = {};
	ACAPI_Selection_Get(&amp;amp;rSelectionInfo, &amp;amp;aSelection, false);
	for (auto&amp;amp; rNeig : aSelection)
	{
		API_Elem_Head head{};
		head.guid = rNeig.guid;
		auto objectID = IFCAPI::GetObjectAccessor().CreateElementObjectID(head);
		//
		DBPrintf("TestApi(): 1\n");
		if (objectID.IsErr())
		{
			ACAPI_WriteReport("TestApi(): CreateElementObjectID failed for element ", true);
			return;
		}
		//
		IFCAPI::PropertyAccessor propertyAccessor = IFCAPI::PropertyAccessor(objectID.Unwrap());
		auto properties = propertyAccessor.GetAttributes();
		if (properties.IsErr())
		{
			ACAPI_WriteReport("TestApi(): GetAttributes failed for element", true);
			return;
		}
		DBPrintf("TestApi(): 2\n");
		//
		auto oIfcAttributes = properties.Unwrap();
		DBPrintf("TestApi(): 3\n");
		DBPrintf("Number of attributes: %zu\n", oIfcAttributes.size());
		//
		for (auto&amp;amp; rIfcAttribute : oIfcAttributes)
		{
			if (rIfcAttribute.GetName().IsEmpty()) continue;
			//
			if (!rIfcAttribute.GetValue().has_value()) continue;
			//
			DBPrintf("Attribute Name0: %s\n", rIfcAttribute.GetName().ToCStr().Get());
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 11 25H2&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 13:30:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/IFCAPI-PropertyAccessor-GetAttributes-issue-in-custom-add-on/m-p/710053#M10992</guid>
      <dc:creator>larsr</dc:creator>
      <dc:date>2026-07-28T13:30:27Z</dc:date>
    </item>
  </channel>
</rss>

