<?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: What action can trigger API_IAttributeEventHandler in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635186#M9880</link>
    <description>&lt;P&gt;Ok,I'll go back and try. Thank you very much.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2024 11:49:17 GMT</pubDate>
    <dc:creator>WalterWhite</dc:creator>
    <dc:date>2024-10-10T11:49:17Z</dc:date>
    <item>
      <title>What action can trigger API_IAttributeEventHandler</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635170#M9878</link>
      <description>&lt;P&gt;I find that the APIdefs_Callback.h file has API_IAttributeEventHandler, and I want to know what action can be triggered.I tried to change the material of the element but it didn't trigger.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 09:29:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635170#M9878</guid>
      <dc:creator>WalterWhite</dc:creator>
      <dc:date>2024-10-10T09:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: What action can trigger API_IAttributeEventHandler</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635180#M9879</link>
      <description>&lt;P&gt;I think it's triggered when you change the attribute definitions themselves in the Attribute Manager, Attribute Palette or specific Attribute Dialog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to catch a material change in an element, then you'll need APINotifyElement_Change.&lt;BR /&gt;Checkout the Notification_Manager example.&lt;BR /&gt;Also here's a related code example: &lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#gad0a9295057964fa5e4a3cfd105bf52d9" target="_blank"&gt;https://graphisoft.github.io/archicad-api-devkit/group___element.html#gad0a9295057964fa5e4a3cfd105bf52d9&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 10:09:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635180#M9879</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2024-10-10T10:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: What action can trigger API_IAttributeEventHandler</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635186#M9880</link>
      <description>&lt;P&gt;Ok,I'll go back and try. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 11:49:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635186#M9880</guid>
      <dc:creator>WalterWhite</dc:creator>
      <dc:date>2024-10-10T11:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: What action can trigger API_IAttributeEventHandler</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635257#M9881</link>
      <description>&lt;P&gt;API_IAttributeEventHandler is called in case of an attribute created, modified, or deleted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to create a class inherited from&amp;nbsp;API_IAttributeEventHandler like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;class AttributeEventHandler : public API_IAttributeEventHandler
{
public:
    virtual void OnCreated (const GS::HashSet&amp;lt;API_Guid&amp;gt;&amp;amp;) const override
    {
        // do something
    }

    virtual void OnModified (const GS::HashSet&amp;lt;API_Guid&amp;gt;&amp;amp;) const override
    {
        // do something
    }

    virtual void OnDeleted (const GS::HashSet&amp;lt;API_Guid&amp;gt;&amp;amp;) const override
    {
        // do something
    }
};
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you need to register the event handler like this in the&amp;nbsp;Initialize function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_Guid eventHandlerId;
ACAPI_Notification_RegisterEventHandler (GS::NewOwned&amp;lt;AttributeEventHandler&amp;gt; (), eventHandlerId);
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 15:33:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635257#M9881</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2024-10-10T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: What action can trigger API_IAttributeEventHandler</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635372#M9885</link>
      <description>&lt;P&gt;Ok, I'll have a try&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 10:37:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/What-action-can-trigger-API-IAttributeEventHandler/m-p/635372#M9885</guid>
      <dc:creator>WalterWhite</dc:creator>
      <dc:date>2024-10-11T10:37:42Z</dc:date>
    </item>
  </channel>
</rss>

