<?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: 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/710605#M11002</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've asked the developer for support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tamás&lt;/P&gt;</description>
    <pubDate>Mon, 03 Aug 2026 06:53:27 GMT</pubDate>
    <dc:creator>Tamas Polyak</dc:creator>
    <dc:date>2026-08-03T06:53: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>
    <item>
      <title>Re: 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/710605#M11002</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've asked the developer for support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tamás&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2026 06:53:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/IFCAPI-PropertyAccessor-GetAttributes-issue-in-custom-add-on/m-p/710605#M11002</guid>
      <dc:creator>Tamas Polyak</dc:creator>
      <dc:date>2026-08-03T06:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: 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/710878#M11003</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Here below is the answer from the developer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Tamás&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-local-id="bb8f6930f396" data-renderer-start-pos="1"&gt;&lt;EM&gt;Based on the APIDevKit 29 sample and headers, the &lt;SPAN class="acronym-highlight"&gt;IFCAPI&lt;/SPAN&gt; does not appear to require any special explicit initialization in the add-on before use. The IFC_Test example only uses normal add-on registration/initialization, then calls IFCAPI directly.&lt;/EM&gt;&lt;/P&gt;
&lt;P data-local-id="9e5fda680588" data-renderer-start-pos="257"&gt;&lt;EM&gt;The main documented prerequisite is that the &lt;SPAN class="acronym-highlight"&gt;IFC&lt;/SPAN&gt; In-Out module must be available, in which case missing support should normally come back as an error such as APIERR_MODULNOTINSTALLED, not as a separate init failure. Since CreateElementObjectID succeeds in the user’s case, this looks less like a missing IFC module and more like either a context/build difference between IFC_Test and the user’s add-on, or rather a difference in the selected element / active database at the time of the call.&lt;/EM&gt;&lt;/P&gt;
&lt;P data-local-id="a106e1f91d84" data-renderer-start-pos="751"&gt;&lt;EM&gt;I would suggest checking:&lt;/EM&gt;&lt;/P&gt;
&lt;OL class="ak-ol" start="1" data-indent-level="1" data-local-id="5fb3f104f414"&gt;
&lt;LI&gt;
&lt;P data-local-id="3286b260fea8" data-renderer-start-pos="780"&gt;&lt;EM&gt;Whether the add-on is built and linked the same way as IFC_Test, including IFC-related module libraries.&lt;/EM&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-local-id="48f10e4ce798" data-renderer-start-pos="888"&gt;&lt;EM&gt;Whether the code is executed from the same kind of context as the sample, for example: same view, same selection, same form of menu commands.&lt;/EM&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-local-id="3459c04c8e7f" data-renderer-start-pos="1033"&gt;&lt;EM&gt;The exact results of GetIFCType and GetGlobalId for the same ObjectID, and the exact error/status of GetAttributes if available.&lt;/EM&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P data-local-id="6c952e375caf" data-renderer-start-pos="1165"&gt;&lt;EM&gt;So at this point I would not expect a hidden “enable IFCAPI first” step, but rather a runtime context or project setup difference between the sample add-on and the custom add-on.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2026 10:50:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/IFCAPI-PropertyAccessor-GetAttributes-issue-in-custom-add-on/m-p/710878#M11003</guid>
      <dc:creator>Tamas Polyak</dc:creator>
      <dc:date>2026-08-05T10:50:22Z</dc:date>
    </item>
  </channel>
</rss>

