<?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 Teamwork Issues when Updating Files in the Embedded Library in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Teamwork-Issues-when-Updating-Files-in-the-Embedded-Library/m-p/667141#M10468</link>
    <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I'm developing an Archicad Add-On for client of mine and we are facing a Teamwork issue for a long time. Unfortunately the Developer Support wasn't yet able to help us and it's been a while since we got an answer. Originally it only occurred in AC27 but in the meantime also in AC26 &amp;amp; AC28.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The issues happen in Teamwork when updating (text-)files in the embedded library.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;There seem to be two conflicting issues:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;We have to delete embedded .txt-files before overwriting them.&lt;/STRONG&gt; Otherwise the files are reset to their previous state after closing and reopening the project. This issue happens both for Non-Teamwork and Teamwork files. As a workaround we started to first delete the embedded .txt-file and then copy the updated file into the embedded library.&amp;nbsp; This workaround works in both cases.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Point 1 sometimes (not always) leads to Teamwork errors.&lt;/STRONG&gt; ("Error in the last Teamwork Operation ....").&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Here's some pseudocode of our current approach:&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ReceiveChanges
ReloadLibraries

GetLockableStatus (ExistingLibItemRefGuid)
if (lockableExists) { ReserveLockable (ExistingLibItemRefGuid) }

DeleteEmbeddedLibItem // Seems necessary to properly update embedded lib items

CopyFileIntoLibrary   // (with overwrite=true but probably not relevant bc. we delete it anyway)

// ERROR happens in this following line
ReleaseLockable (NewLibItemRefGuid)

ReloadLibraries
SendChanges&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;We've tested several orders of operations of deleting/overwriting/copying/receiving/releasing/reserving/sending but haven't yet found any error-free approach. Does anybody have any tip or hint what I might be missing?&lt;BR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12765"&gt;@Viktor Kovacs&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/11183"&gt;@Tibor Lorantfy&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7122"&gt;@Akos Somorjai&lt;/a&gt;&amp;nbsp;maybe you have some special insights into this?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;Bernd&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jul 2025 11:17:27 GMT</pubDate>
    <dc:creator>BerndSchwarzenbacher</dc:creator>
    <dc:date>2025-07-02T11:17:27Z</dc:date>
    <item>
      <title>Teamwork Issues when Updating Files in the Embedded Library</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Teamwork-Issues-when-Updating-Files-in-the-Embedded-Library/m-p/667141#M10468</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I'm developing an Archicad Add-On for client of mine and we are facing a Teamwork issue for a long time. Unfortunately the Developer Support wasn't yet able to help us and it's been a while since we got an answer. Originally it only occurred in AC27 but in the meantime also in AC26 &amp;amp; AC28.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The issues happen in Teamwork when updating (text-)files in the embedded library.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;There seem to be two conflicting issues:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;We have to delete embedded .txt-files before overwriting them.&lt;/STRONG&gt; Otherwise the files are reset to their previous state after closing and reopening the project. This issue happens both for Non-Teamwork and Teamwork files. As a workaround we started to first delete the embedded .txt-file and then copy the updated file into the embedded library.&amp;nbsp; This workaround works in both cases.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Point 1 sometimes (not always) leads to Teamwork errors.&lt;/STRONG&gt; ("Error in the last Teamwork Operation ....").&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Here's some pseudocode of our current approach:&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ReceiveChanges
ReloadLibraries

GetLockableStatus (ExistingLibItemRefGuid)
if (lockableExists) { ReserveLockable (ExistingLibItemRefGuid) }

DeleteEmbeddedLibItem // Seems necessary to properly update embedded lib items

CopyFileIntoLibrary   // (with overwrite=true but probably not relevant bc. we delete it anyway)

// ERROR happens in this following line
ReleaseLockable (NewLibItemRefGuid)

ReloadLibraries
SendChanges&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;We've tested several orders of operations of deleting/overwriting/copying/receiving/releasing/reserving/sending but haven't yet found any error-free approach. Does anybody have any tip or hint what I might be missing?&lt;BR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12765"&gt;@Viktor Kovacs&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/11183"&gt;@Tibor Lorantfy&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7122"&gt;@Akos Somorjai&lt;/a&gt;&amp;nbsp;maybe you have some special insights into this?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 11:17:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Teamwork-Issues-when-Updating-Files-in-the-Embedded-Library/m-p/667141#M10468</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2025-07-02T11:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Teamwork Issues when Updating Files in the Embedded Library</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Teamwork-Issues-when-Updating-Files-in-the-Embedded-Library/m-p/669946#M10500</link>
      <description>&lt;P&gt;The solution is to register the .txt file as a macro library part (ACAPI_LibPart_Register) after copying it into the library and before releasing the library item.&amp;nbsp;Then it's no longer necessary to delete the file beforehand. So far this approach solved all teamwork issues we had and didn't lead to any others.&lt;/P&gt;
&lt;P&gt;I also dropped the reload library commands as they were no longer necessary.&lt;BR /&gt;&lt;BR /&gt;Huge thanks to&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12765"&gt;@Viktor Kovacs&lt;/a&gt; for the hint!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 13:38:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Teamwork-Issues-when-Updating-Files-in-the-Embedded-Library/m-p/669946#M10500</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2025-07-16T13:38:48Z</dc:date>
    </item>
  </channel>
</rss>

