<?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: Monitor copied-pasted elements in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/695877#M10819</link>
    <description>&lt;P&gt;My answer is similar to my earlier&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693706/highlight/true#M10792" target="_self"&gt;reply&lt;/A&gt; to your &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693278/highlight/true#M10787" target="_self"&gt;undo-monitoring question&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To detect when an element is copied — &lt;EM&gt;whether by standard copy, drag‑copy, rotation, or mirroring&lt;/EM&gt; — you &lt;SPAN&gt;must first attach an observer to every element &lt;/SPAN&gt;that you want to track, by&amp;nbsp;&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;A title="ACAPI_Element_AttachObserver" href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#ga4e7696dc5135c83ca77fc0c076222adf" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT color="#800080"&gt;ACAPI_Element_AttachObserver&lt;/FONT&gt;&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;This marks the element as &lt;EM&gt;observable&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next, install a global element observer with&amp;nbsp;&lt;/SPAN&gt;&lt;A title="ACAPI_Element_InstallElementObserver" href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#gad0a9295057964fa5e4a3cfd105bf52d9" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT color="#800080"&gt;ACAPI_Element_InstallElementObserver&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN&gt;, which registers your&amp;nbsp;&lt;/SPAN&gt;&lt;A title="APIElementEventHandlerProc" href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#ga9e9c70a4b6e772cfab4b910175429033" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT color="#800080"&gt;APIElementEventHandlerProc&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;callback.&amp;nbsp;Whenever an observed element is &lt;STRONG&gt;copied&lt;/STRONG&gt;, modified, deleted, or restored, Archicad calls your handler and sends notifications grouped between&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;FONT color="#800080"&gt;APINotifyElement_BeginEvents&lt;/FONT&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#800080"&gt;APINotifyElement_EndEvents&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Inside this handler, you can collect GUIDs, detect &lt;STRONG&gt;copy-operations&lt;/STRONG&gt;, or react to any other changes. (In my earlier&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693706/highlight/true#M10792" target="_blank" rel="noopener"&gt;reply&lt;/A&gt; about&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693278/highlight/true#M10787" target="_blank" rel="noopener"&gt;undo-monitoring question&lt;/A&gt;, I did not mention copy events because your question there focused specifically on modifications, deletions, and restorations.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// Your APIElementEventHandlerProc callback that should be registered via
// ACAPI_Element_InstallElementObserver, e.g., in your add-on's Initialize function
GSErrCode ElementEventHandler (const API_NotifyElementType* notifyElementType)
{
	GSErrCode err = GS::NoError;

	API_Element parentElement{};

	// Retrieves the parent of the element that triggered the notification.
	// If no parent exists for the action, returns APIERR_REFUSEDCMD.
	// If you pass nullptr values in the memo and userData parameters, the
	// function performs an ACAPI_Element_Get operation, otherwise it behaves
	// like the ACAPI_Element_GetMemo or the ACAPI_Element_GetUserData function
	err = ACAPI_Notification_GetParentElement (&amp;amp;parentElement, nullptr, 0, nullptr);

	// Handle errors as needed...

	switch (notifyElementType-&amp;gt;notifID) {
		case API_ElementDBEventID::APINotifyElement_Copy:
		{
			GS::UniString elementTypeName;

			const GS::UniString copiedElementGuidString = APIGuidToString (notifyElementType-&amp;gt;elemHead.guid);
			const GS::UniString parentElementGuidString = APIGuidToString (parentElement.header.guid);

			if (parentElement.header.guid != APINULLGuid &amp;amp;&amp;amp;
				(ACAPI_Element_GetElemTypeName (notifyElementType-&amp;gt;elemHead.type, elemTypeName) == GS::NoError)) {

				const GS::UniString message = GS::UniString::Printf ( 
					"%T #%T copied from #%T",
					&amp;amp;elementTypeName,
					&amp;amp;copiedElementGuidString,
					&amp;amp;parentElementGuidString);

				// Attach observer to the new clone so it can be tracked in future (copy or other) operations
				err = ACAPI_Element_AttachObserver (notifyElementType-&amp;gt;elemHead.guid, 0);

				// Handle errors as needed...

				// Report the event
				DG::InformationAlert ("Copy has been detected", message, "OK");
			}

		// Handle other notification cases...
	}

	return err;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The attached animation shows exactly how the process unfolds. Since you also obtain the GUID of the parent element, you can access its IFC or other parameters and pass them on to the clone.&lt;/P&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="copy-detection.gif" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/98465i74290E51D1B95E4B/image-size/large?v=v2&amp;amp;px=999" role="button" title="copy-detection.gif" alt="copy-detection.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2026 19:45:24 GMT</pubDate>
    <dc:creator>Corpora Geometrica</dc:creator>
    <dc:date>2026-03-13T19:45:24Z</dc:date>
    <item>
      <title>Monitor copied-pasted elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/695120#M10811</link>
      <description>&lt;P&gt;Hello everyone. Does anyone know how can I detected whether or not an element was: "drag a copy"-ed, "rotate a copy"-ed, "mirror a copy"-ed? I need the IFC parameters copied as well, however they don't.&lt;BR /&gt;&lt;BR /&gt;Unfortunately, ACAPI_Element_CatchNewElement does not work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2026 14:29:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/695120#M10811</guid>
      <dc:creator>Emkave</dc:creator>
      <dc:date>2026-03-06T14:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor copied-pasted elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/695877#M10819</link>
      <description>&lt;P&gt;My answer is similar to my earlier&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693706/highlight/true#M10792" target="_self"&gt;reply&lt;/A&gt; to your &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693278/highlight/true#M10787" target="_self"&gt;undo-monitoring question&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To detect when an element is copied — &lt;EM&gt;whether by standard copy, drag‑copy, rotation, or mirroring&lt;/EM&gt; — you &lt;SPAN&gt;must first attach an observer to every element &lt;/SPAN&gt;that you want to track, by&amp;nbsp;&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;A title="ACAPI_Element_AttachObserver" href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#ga4e7696dc5135c83ca77fc0c076222adf" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT color="#800080"&gt;ACAPI_Element_AttachObserver&lt;/FONT&gt;&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;This marks the element as &lt;EM&gt;observable&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next, install a global element observer with&amp;nbsp;&lt;/SPAN&gt;&lt;A title="ACAPI_Element_InstallElementObserver" href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#gad0a9295057964fa5e4a3cfd105bf52d9" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT color="#800080"&gt;ACAPI_Element_InstallElementObserver&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN&gt;, which registers your&amp;nbsp;&lt;/SPAN&gt;&lt;A title="APIElementEventHandlerProc" href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#ga9e9c70a4b6e772cfab4b910175429033" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT color="#800080"&gt;APIElementEventHandlerProc&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;callback.&amp;nbsp;Whenever an observed element is &lt;STRONG&gt;copied&lt;/STRONG&gt;, modified, deleted, or restored, Archicad calls your handler and sends notifications grouped between&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;FONT color="#800080"&gt;APINotifyElement_BeginEvents&lt;/FONT&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#800080"&gt;APINotifyElement_EndEvents&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Inside this handler, you can collect GUIDs, detect &lt;STRONG&gt;copy-operations&lt;/STRONG&gt;, or react to any other changes. (In my earlier&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693706/highlight/true#M10792" target="_blank" rel="noopener"&gt;reply&lt;/A&gt; about&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Monitor-undos/m-p/693278/highlight/true#M10787" target="_blank" rel="noopener"&gt;undo-monitoring question&lt;/A&gt;, I did not mention copy events because your question there focused specifically on modifications, deletions, and restorations.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// Your APIElementEventHandlerProc callback that should be registered via
// ACAPI_Element_InstallElementObserver, e.g., in your add-on's Initialize function
GSErrCode ElementEventHandler (const API_NotifyElementType* notifyElementType)
{
	GSErrCode err = GS::NoError;

	API_Element parentElement{};

	// Retrieves the parent of the element that triggered the notification.
	// If no parent exists for the action, returns APIERR_REFUSEDCMD.
	// If you pass nullptr values in the memo and userData parameters, the
	// function performs an ACAPI_Element_Get operation, otherwise it behaves
	// like the ACAPI_Element_GetMemo or the ACAPI_Element_GetUserData function
	err = ACAPI_Notification_GetParentElement (&amp;amp;parentElement, nullptr, 0, nullptr);

	// Handle errors as needed...

	switch (notifyElementType-&amp;gt;notifID) {
		case API_ElementDBEventID::APINotifyElement_Copy:
		{
			GS::UniString elementTypeName;

			const GS::UniString copiedElementGuidString = APIGuidToString (notifyElementType-&amp;gt;elemHead.guid);
			const GS::UniString parentElementGuidString = APIGuidToString (parentElement.header.guid);

			if (parentElement.header.guid != APINULLGuid &amp;amp;&amp;amp;
				(ACAPI_Element_GetElemTypeName (notifyElementType-&amp;gt;elemHead.type, elemTypeName) == GS::NoError)) {

				const GS::UniString message = GS::UniString::Printf ( 
					"%T #%T copied from #%T",
					&amp;amp;elementTypeName,
					&amp;amp;copiedElementGuidString,
					&amp;amp;parentElementGuidString);

				// Attach observer to the new clone so it can be tracked in future (copy or other) operations
				err = ACAPI_Element_AttachObserver (notifyElementType-&amp;gt;elemHead.guid, 0);

				// Handle errors as needed...

				// Report the event
				DG::InformationAlert ("Copy has been detected", message, "OK");
			}

		// Handle other notification cases...
	}

	return err;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The attached animation shows exactly how the process unfolds. Since you also obtain the GUID of the parent element, you can access its IFC or other parameters and pass them on to the clone.&lt;/P&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="copy-detection.gif" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/98465i74290E51D1B95E4B/image-size/large?v=v2&amp;amp;px=999" role="button" title="copy-detection.gif" alt="copy-detection.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2026 19:45:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/695877#M10819</guid>
      <dc:creator>Corpora Geometrica</dc:creator>
      <dc:date>2026-03-13T19:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor copied-pasted elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/699806#M10835</link>
      <description>&lt;P&gt;Thank you for the responses!!! It all works. However, now I have a little another issue. When I place a wall, then perform operations on it like that:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&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="Emkave_0-1776341347702.png" style="width: 800px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/99936i3168B06421D1E598/image-dimensions/800x325?v=v2" width="800" height="325" role="button" title="Emkave_0-1776341347702.png" alt="Emkave_0-1776341347702.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we are effectively having more walls there. However, when I tried to debug the event, the event was: "APINotifyElement_Edit" and no any other event that would be related to such operation was returned. Sooo I wonder how can I monitor such action as well.&lt;BR /&gt;&lt;BR /&gt;Thank you again for the assistance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 18:24:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Monitor-copied-pasted-elements/m-p/699806#M10835</guid>
      <dc:creator>Emkave</dc:creator>
      <dc:date>2026-04-17T18:24:26Z</dc:date>
    </item>
  </channel>
</rss>

