<?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: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664061#M10417</link>
    <description>&lt;P&gt;To supplement the explanation to the readers, I am currently using ACAPI_Notification_CatchViewEvent(APINotifyView_Opened, API_PublicViewMap, ViewNotificationHandlerProc) Replaced ACAPI_ProjectOperation_CatchProjectEvent(APINotify_AllInputFinished, NotificationHandler)，&lt;BR /&gt;The timing of the ViewNotificationHandlerProc trigger is later, which is more in line with my needs.&lt;/P&gt;</description>
    <pubDate>Thu, 29 May 2025 07:35:02 GMT</pubDate>
    <dc:creator>sxs</dc:creator>
    <dc:date>2025-05-29T07:35:02Z</dc:date>
    <item>
      <title>why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663291#M10381</link>
      <description>&lt;P&gt;&amp;nbsp; Hi, everyone:&lt;BR /&gt;&amp;nbsp; first, this is part of my code:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;static GSErrCode NotificationHandler(API_NotifyEventID notifID, Int32 param)
{
	char    msgStr[256];

	switch (notifID) {
	case APINotify_New:                CHCopyC("APINotify_New", msgStr);             break;
	case APINotify_NewAndReset:        CHCopyC("APINotify_NewAndReset", msgStr);     break;
	case APINotify_Open:               CHCopyC("APINotify_Open", msgStr);            break;
	case APINotify_PreSave:            CHCopyC("APINotify_PreSave", msgStr);         break;
	case APINotify_Save:               CHCopyC("APINotify_Save", msgStr);            break;
	case APINotify_Close:              CHCopyC("APINotify_Close", msgStr);           break;
	case APINotify_Quit:               CHCopyC("APINotify_Quit", msgStr);            break;

	case APINotify_SendChanges:        CHCopyC("APINotify_SendChanges", msgStr);     break;
	case APINotify_ReceiveChanges:     CHCopyC("APINotify_ReceiveChanges", msgStr);  break;

	case APINotify_ChangeProjectDB:    CHCopyC("APINotify_ChangeProjectDB", msgStr); break;
	case APINotify_ChangeWindow:       CHCopyC("APINotify_ChangeWindow", msgStr);    break;
	case APINotify_ChangeFloor:        CHCopyC("APINotify_ChangeFloor", msgStr);     break;
	case APINotify_ChangeLibrary:      CHCopyC("APINotify_ChangeLibrary", msgStr);   break;
	case APINotify_AllInputFinished:      CHCopyC("APINotify_AllInputFinished", msgStr);   break;
	}

	//
	void* origSight;
	auto err = ACAPI_Sight_SelectSight(nullptr, &amp;amp;origSight);
	if (err != NoError) {
		//ErrorBeep("Cannot switch to the 3D sight", err);
		ACAPI_WriteReport("Cannot switch to the 3D sight", true);
		return err;
	}
	//
	{
          Int32		nbody;
          err = ACAPI_ModelAccess_GetNum (API_BodyID, &amp;amp;nbody);// nbody is zero, but there are many elements
        }

	ACAPI_WriteReport(msgStr, true);

	return NoError;
}   // NotificationHandler


API_AddonType CheckEnvironment (API_EnvirParams* envir)
{
	RSGetIndString (&amp;amp;envir-&amp;gt;addOnInfo.name, ID_ADDON_INFO, 1, ACAPI_GetOwnResModule ());
	RSGetIndString (&amp;amp;envir-&amp;gt;addOnInfo.description, ID_ADDON_INFO, 2, ACAPI_GetOwnResModule ());

	return APIAddon_Preload;// this is important
}		// CheckEnvironment

GSErrCode Initialize	(void)
{	
        auto err = ACAPI_ProjectOperation_CatchProjectEvent(APINotify_AllInputFinished, NotificationHandler);

	return NoError;
}		// Initialize&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;my goal is to get geometry of all elements in&amp;nbsp;NotificationHandler,but it does not works, the count of Body i get is zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;so, what's wrong with the code.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 08:56:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663291#M10381</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-22T08:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663320#M10382</link>
      <description>&lt;P&gt;The function&amp;nbsp;ACAPI_ModelAccess_GetNum will count the number of bodies in the 3D view - is anything displayed in the 3D view when you call it? Also, have you checked if an error code is returned from the function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an aside, I wouldn't use this function every time a project notification is emitted - otherwise this will be called repeatedly for no purpose. Also don't forget to call&amp;nbsp;ACAPI_Sight_SelectSight afterward to switch back to the original view when you've collected the data.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 13:30:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663320#M10382</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-05-22T13:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663400#M10384</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1,This is the 3d model:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sxs_0-1747966335962.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/87179iDBEEFA50DE19339B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sxs_0-1747966335962.png" alt="sxs_0-1747966335962.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I don't know if I called it at the wrong time, but I can get wall by this code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GS::Array&amp;lt;API_Guid&amp;gt; wallList;
ACAPI_Element_GetElemList(API_WallID, &amp;amp;wallList);&lt;/LI-CODE&gt;&lt;P&gt;2,I have confirmed that it returned NoError.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 02:22:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663400#M10384</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-23T02:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663473#M10390</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/160656"&gt;@sxs&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;I don't know if I called it at the wrong time, but I can get wall by this code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GS::Array&amp;lt;API_Guid&amp;gt; wallList;
ACAPI_Element_GetElemList(API_WallID, &amp;amp;wallList);&lt;/LI-CODE&gt;
&lt;P&gt;2,I have confirmed that it returned NoError.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I need to know a bit more about you are planning to develop to answer the question properly. Do you want 3D geometry (bodies, faces, vertices etc) or information about the construction elements in the project? I'm asking because the 2 commands you mentioned (&lt;EM&gt;ACAPI_ModelAccess_GetNum&lt;/EM&gt; and&amp;nbsp;&lt;EM&gt;ACAPI_Element_GetElemList&lt;/EM&gt;) extract data from two different sources:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Project database: This is the data that persists when you save an Archicad project. This is designed to contain as little raw 3D geometry as possible - instead, elements are described by parameters and metadata. The 2D/3D geometry is only created on demand when you open and view the project. This data is obtained using commands like&amp;nbsp;&lt;EM&gt;ACAPI_Element_GetElemList&lt;/EM&gt;. The data returned by these functions will not change unless new elements are created, edited or deleted, e.g. the number of walls returned by&amp;nbsp;&lt;EM&gt;ACAPI_Element_GetElemList&amp;nbsp;&lt;/EM&gt;won't change unless a wall is added/removed in the project database.&lt;/LI&gt;
&lt;LI&gt;Model database: This data is only created on demand (never saved in the project) and can vary according to what the user is currently viewing. If you select 3 elements and view them in 3D, the model database will contain only 3 objects (irrespective of the project database content). This data is retrieved with functions like&amp;nbsp;&lt;EM&gt;ACAPI_ModelAccess_GetNum&lt;/EM&gt;, and the returned values will change dynamically according to the 3D window content, e.g. if the 3D window is empty/unpopulated,&amp;nbsp;&lt;EM&gt;ACAPI_ModelAccess_GetNum&amp;nbsp;&lt;/EM&gt;will return 0.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 23 May 2025 10:22:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663473#M10390</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-05-23T10:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663476#M10391</link>
      <description>&lt;P&gt;Thank you, I understand now。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;&lt;SPAN&gt;want 3D geometry (bodies, faces, vertices etc), so&amp;nbsp;What api is suitable for me?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 10:31:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663476#M10391</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-23T10:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663479#M10392</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;How to get&amp;nbsp;3D geometry (bodies, faces, vertices etc)&amp;nbsp; in NotificationHandler of project notification?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Maybe you would recommend ACAPI_Sight_SelectSight, but I've tried it and it didn't work。&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 10:39:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663479#M10392</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-23T10:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663493#M10395</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/160656"&gt;@sxs&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;How to get&amp;nbsp;3D geometry (bodies, faces, vertices etc)&amp;nbsp; in NotificationHandler of project notification?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Maybe you would recommend ACAPI_Sight_SelectSight, but I've tried it and it didn't work。&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;it would help to understand what you want to do. I suspect that using project event notifications (open, save, close etc) are probably not what you want, but I can't definitely say without knowing why you want the 3D geometry. If a user has just opened a project (for example) the model will always be empty because it hasn't been viewed yet. Archicad doesn't automatically do this because building 3D geometry can be very processor-intensive and it's wasted until the user has actually asked to see something specific in 3D.&lt;/P&gt;
&lt;P&gt;If you want to export the 3D geometry in a different format (for example) then there are APIs for plugging directly into Archicad's 'Save As…' functionality. If you explain what you would like to do, I could point in the best direction for accomplishing it.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 20:56:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663493#M10395</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-05-23T20:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663608#M10397</link>
      <description>&lt;P&gt;“&lt;SPAN&gt;If you want to export the 3D geometry in a different format (for example)&lt;/SPAN&gt;”, it is my goal, but I want to do this without any user operation like clicking menu button, I want to create an automic plugin to&amp;nbsp;&lt;SPAN&gt;export the 3D geometry in a different format. The&amp;nbsp;automation plugin means that once Archicad completes opening the model file, the plugin will run directly without any user intervention like clicking menu button.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 01:34:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663608#M10397</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-26T01:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663955#M10410</link>
      <description>&lt;P&gt;Try bringing the 3D window to the front (see my separate reply on a different thread) and then use &lt;EM&gt;ACAPI_View_Rebuild&lt;/EM&gt;. I think you may need to pass a &lt;EM&gt;true&lt;/EM&gt; value in the&amp;nbsp;&lt;EM&gt;doRebuildAndRegenerate&lt;/EM&gt; parameter.&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 11:49:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/663955#M10410</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-05-28T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664057#M10416</link>
      <description>&lt;P&gt;Okay, thank you. I'll give it a try&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 06:49:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664057#M10416</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-29T06:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664061#M10417</link>
      <description>&lt;P&gt;To supplement the explanation to the readers, I am currently using ACAPI_Notification_CatchViewEvent(APINotifyView_Opened, API_PublicViewMap, ViewNotificationHandlerProc) Replaced ACAPI_ProjectOperation_CatchProjectEvent(APINotify_AllInputFinished, NotificationHandler)，&lt;BR /&gt;The timing of the ViewNotificationHandlerProc trigger is later, which is more in line with my needs.&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 07:35:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664061#M10417</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-29T07:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: why NotificationHandler of ACAPI_ProjectOperation_CatchProjectEvent get zero body?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664066#M10419</link>
      <description>&lt;LI-CODE lang="cpp"&gt;	//
	{
		API_WindowInfo      windowInfo;
		API_DatabaseInfo    origDB, planDB;
		API_Element         element;
		GS::Array&amp;lt;API_Guid&amp;gt; elemList;
		GSErrCode           err;

		BNZeroMemory(&amp;amp;planDB, sizeof(API_DatabaseInfo));
		planDB.typeID = APIWind_3DModelID;

		//ACAPI_Database(APIDb_GetCurrentDatabaseID, &amp;amp;origDB, nullptr);
		ACAPI_Database_ChangeCurrentDatabase(&amp;amp;planDB);
		//
		BNZeroMemory(&amp;amp;windowInfo, sizeof(API_WindowInfo));
		windowInfo.typeID = APIWind_3DModelID;
		windowInfo.databaseUnId = planDB.databaseUnId;
		err = ACAPI_Window_ChangeWindow(&amp;amp;windowInfo);
	}
	//
	if (err == NoError)
	{
		bool is_rebuild = true;
		ACAPI_View_Rebuild(&amp;amp;is_rebuild);
	}
	//
	{
		{
			void* origSight;
			GSErrCode	err;

			err = ACAPI_Sight_SelectSight(nullptr, &amp;amp;origSight);
		}

		//
		Int32 nbody;
		auto err = ACAPI_ModelAccess_GetNum(API_BodyID, &amp;amp;nbody);

		WriteReport_Alert("body num %d", nbody);
	}&lt;/LI-CODE&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="sxs_0-1748509658786.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/87375i27C6105A66A8506B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sxs_0-1748509658786.png" alt="sxs_0-1748509658786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 09:07:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/why-NotificationHandler-of-ACAPI-ProjectOperation/m-p/664066#M10419</guid>
      <dc:creator>sxs</dc:creator>
      <dc:date>2025-05-29T09:07:50Z</dc:date>
    </item>
  </channel>
</rss>

