<?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: Capture the change (addition/deletion/rename) of Story Settings in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309076#M1805</link>
    <description>&lt;P&gt;You are right. That example is very misleading!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 14:03:11 GMT</pubDate>
    <dc:creator>BerndSchwarzenbacher</dc:creator>
    <dc:date>2021-10-12T14:03:11Z</dc:date>
    <item>
      <title>Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/308777#M1798</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is there any notification of the change in Story settings that can be captured by an add-on?&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0066"&gt;&lt;SPAN class="hljs-function"&gt;ACAPI_Notify_CatchProjectEvent&lt;/SPAN&gt;&lt;/FONT&gt; (&lt;SPAN class="hljs-type"&gt;API_AllProjectNotificationMask,&lt;/SPAN&gt; NotificationHandler);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and tried capturing the notification ID "APINotify_ChangeFloor"&amp;nbsp; but that doesn't trigger upon adding or removing a story in the project from 'Story settings'.&lt;/P&gt;&lt;P&gt;How can I capture the addition/deletion/rename of stories in the project?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 06:32:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/308777#M1798</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-10-09T06:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/308897#M1799</link>
      <description>&lt;P&gt;I haven't tried it myself, but I saw something in the Documentation of &lt;A href="https://archicadapi.graphisoft.com/documentation/apiprojecteventhandlerproc" target="_blank" rel="noopener"&gt;APIProjectEventHandlerProc&lt;/A&gt;. It seems like you can catch "APINotify_ChangeProjectDB" and if the "param" parameter of your handler callback has value 1 it means that the floors changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 09:45:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/308897#M1799</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2021-10-11T09:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/308911#M1800</link>
      <description>&lt;P&gt;I tried that, but adding/deleting floors does not pass notifID as "APINotify_ChangeProjectDB".&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 12:40:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/308911#M1800</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-10-11T12:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309048#M1801</link>
      <description>&lt;P&gt;Hm.. that's weird. I tried it now also and it seems to work for me.&lt;/P&gt;&lt;P&gt;Here are the relevant code sections I used:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;static GSErrCode __ACENV_CALL ProjectEventHandlerProc (API_NotifyEventID notifID, Int32 param)
{
	switch (notifID) {
		case APINotify_ChangeProjectDB:
		{
			DG::InformationAlert ("Change project DB", "param: " + GS::ValueToUniString (param), "OK");
			break;
		}
		default:	break;
	}
	return NoError;
}

GSErrCode __ACENV_CALL Initialize (void)
{
	GSErrCode err = NoError;
	err = ACAPI_Notify_CatchProjectEvent (APINotify_ChangeProjectDB,
		ProjectEventHandlerProc);
	return err;
}
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;All three actions: Remove/Add/Rename Floor trigger the "APINotify_ChangeProjectDB" with "param = 1" for me.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 09:35:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309048#M1801</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2021-10-12T09:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309050#M1802</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Where is ProjectEventHandlerProc being called from?&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;EDIT: Sorry, I didn't scroll your code &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is what's happening:&lt;/P&gt;&lt;P&gt;I was passing &lt;STRONG&gt;API_AllProjectNotificationMask &lt;/STRONG&gt;to the callback, assuming that it would capture _all_ the events, as I needed to capture another event, like so:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;ACAPI_Notify_CatchProjectEvent (API_AllProjectNotificationMask, NotificationHandler);&lt;/LI-CODE&gt;&lt;P&gt;But it seems it does not.&lt;/P&gt;&lt;P&gt;I tried passing &lt;STRONG&gt;APINotify_ChangeProjectDB &lt;/STRONG&gt;directly and it worked!&lt;/P&gt;&lt;P&gt;That's strange because the example on &lt;A href="https://archicadapi.graphisoft.com/documentation/apiprojecteventhandlerproc" target="_blank"&gt;https://archicadapi.graphisoft.com/documentation/apiprojecteventhandlerproc&lt;/A&gt;&amp;nbsp; shows the case for APINotify_ChangeProjectDB ...&amp;nbsp;&amp;nbsp; Don't know what I'm missing here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, now I have created separate calls for each event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Bernd!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:01:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309050#M1802</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-10-12T11:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309058#M1803</link>
      <description>&lt;P&gt;Glad it works now for you too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes "API_AllProjectNotificationMask" doesn't include "APINotify_ChangeProjectDB". You can check the values of the mask in the AC API header "APIdefs_Callback.h". Here's the relevant part:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#define	API_AllProjectNotificationMask	0x00000FFF				// APINotify_New..APINotify_ConvertGuid
#define	API_AllTeamWorkNotificationMask	0x00018000				// APINotify_Share..APINotify_ChangeWorkspace
#define	API_AllChangeNotificationMask	0x033C0000				// APINotify_ChangeProjectDB..APINotify_ChangeFloor

#define	API_AllNotificationMask			0xFFFFFFFF&lt;/LI-CODE&gt;&lt;P&gt;The example you linked probably uses "API_AllNotificationMask". You can also select multiple notifications by combining them with "OR" like this:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;APINotify_ChangeProjectDB | APINotify_SomeOtherMask | ....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:25:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309058#M1803</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2021-10-12T11:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309061#M1804</link>
      <description>&lt;P&gt;I gave a different ref. link last time, which doesn't have the function call. Check out the example here: &lt;A href="https://archicadapi.graphisoft.com/documentation/acapi_notify_catchprojectevent?s=ACAPI_Notify_CatchProjectEvent" target="_blank" rel="noopener"&gt;https://archicadapi.graphisoft.com/documentation/acapi_notify_catchprojectevent?s=ACAPI_Notify_CatchProjectEvent&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It passes&amp;nbsp;&lt;STRONG&gt;API_AllProjectNotificationMask &lt;/STRONG&gt;, and shows the case for &lt;STRONG&gt;APINotify_ChangeProjectDB.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/8527"&gt;@BerndSchwarzenbacher&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;You can also select multiple notifications by combining them with "OR"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's interesting. Thanks! &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:49:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309061#M1804</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-10-12T11:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the change (addition/deletion/rename) of Story Settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309076#M1805</link>
      <description>&lt;P&gt;You are right. That example is very misleading!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 14:03:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Capture-the-change-addition-deletion-rename-of-Story-Settings/m-p/309076#M1805</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2021-10-12T14:03:11Z</dc:date>
    </item>
  </channel>
</rss>

