<?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: Updating hotlinks:  ..\Examples\ and ClickAnElem() in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376873#M794</link>
    <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added APICommon.c to the project in Visual Studio.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MudratDetector_0-1681745345937.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/36186i25A6967A943CE3A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MudratDetector_0-1681745345937.png" alt="MudratDetector_0-1681745345937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After saving the project and hitting F7 to build, I was getting [&lt;SPAN&gt;error C3861: identifier not found] errors.&amp;nbsp; I solved this by copy/paste-ing the referenced functions from &lt;EM&gt;'APICommon.c'&lt;/EM&gt; into and above the call to those functions in my &lt;EM&gt;'projectname.cpp'&lt;/EM&gt; and commenting these out of the &lt;EM&gt;'APICommon.c'&lt;/EM&gt; file.&amp;nbsp; My menu item now builds without error and executes as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I have to believe that my cut/paste/comment solution is not the path of least resistance.&amp;nbsp; Knowing that the placement/location of the function definition relative to the function call matters, is there a better way to accomplish this without having to resort to my cut/paste/comment solution?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again and thanks for the insight.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2023 16:29:11 GMT</pubDate>
    <dc:creator>MudratDetector</dc:creator>
    <dc:date>2023-04-17T16:29:11Z</dc:date>
    <item>
      <title>Updating hotlinks:  ..\Examples\ and ClickAnElem()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376431#M792</link>
      <description>&lt;P&gt;VS2017 and AC24&lt;BR /&gt;&lt;BR /&gt;I am writing an Add-On to update all hotlinks in a project file.&amp;nbsp; I am starting with&amp;nbsp;&lt;STRONG&gt;Do_UpdateHotlink()&lt;/STRONG&gt; found in the&amp;nbsp; ..\Examples\Element_Test\Src\Element_Hotlink.cpp file.&amp;nbsp; This allows the user to select and update a single hotlink instead of all of them at once.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Do_UpdateHotlink()&lt;/STRONG&gt; calls a function,&amp;nbsp;&lt;STRONG&gt;SelectPlacedHotlinkByClickOnElement()&lt;/STRONG&gt;, that is included in the same&amp;nbsp;Element_Hotlink.cpp file found in ..\Examples\.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SelectPlacedHotlinkByClickOnElement()&lt;/STRONG&gt; calls a function,&amp;nbsp;&lt;STRONG&gt;ClickAnElem()&lt;/STRONG&gt;, that is found in the .\APICommon.h&amp;nbsp; file [in the same folder as my Add-On .cpp file and .hpp file].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* * In Visual Studio, I can hover over the call to&amp;nbsp;&lt;STRONG&gt;ClickAnElem()&lt;/STRONG&gt; and see it expand to the balloon of argument requirements.&lt;/P&gt;&lt;P&gt;* * In Visual Studio, I can click on the call to&amp;nbsp;&lt;STRONG&gt;ClickAnElem(),&lt;/STRONG&gt; press F12, and see it jump to the&amp;nbsp;.\APICommon.h file that contains the definition.&lt;/P&gt;&lt;P&gt;* * I can match the arguments I have provided with the argument requirements and I do not see an issue.&lt;/P&gt;&lt;P&gt;* * I have even added&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include ".\APICommon.h"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;although I do not believe that is necessary.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I build...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;1&amp;gt;JHP_DrawingUpdate.obj : error LNK2019: unresolved external symbol "bool __cdecl ClickAnElem(...
1&amp;gt;Build\x64\Release\JHP_DrawingUpdate.apx : fatal error LNK1120: 1 unresolved externals&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;My code is straight from the&amp;nbsp;&lt;STRONG&gt;SelectPlacedHotlinkByClickOnElement()&lt;/STRONG&gt;&amp;nbsp;function in the ..\Examples file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;if (!ClickAnElem("Click on an element to select a hotlink instance", API_ZombieElemID, nullptr, nullptr, &amp;amp;guid)) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have even modified it to include the last two arguments with default values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;(!ClickAnElem("Click on an element to select a hotlink instance", API_ZombieElemID, nullptr, nullptr, &amp;amp;guid, nullptr, true))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do not understand why that is my error since, by all my accounts, I am able to find the externally defined function.&lt;BR /&gt;&lt;BR /&gt;What am I missing here?&lt;BR /&gt;&lt;BR /&gt;Thanks again for the continued support,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 21:18:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376431#M792</guid>
      <dc:creator>MudratDetector</dc:creator>
      <dc:date>2023-04-12T21:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Updating hotlinks:  ..\Examples\ and ClickAnElem()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376461#M793</link>
      <description>&lt;P&gt;The error means that the compiler found the function definition, but the linker wasn't able to find the compiled version (object file) of that function. Probably it was never compiled. Make sure to add "APICommon.c" (the c file, not the h) to your project. In Visual Studio you can right click on the project, and then select Add/Existing item.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 05:44:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376461#M793</guid>
      <dc:creator>kovacsv</dc:creator>
      <dc:date>2023-04-13T05:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Updating hotlinks:  ..\Examples\ and ClickAnElem()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376873#M794</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added APICommon.c to the project in Visual Studio.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MudratDetector_0-1681745345937.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/36186i25A6967A943CE3A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MudratDetector_0-1681745345937.png" alt="MudratDetector_0-1681745345937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After saving the project and hitting F7 to build, I was getting [&lt;SPAN&gt;error C3861: identifier not found] errors.&amp;nbsp; I solved this by copy/paste-ing the referenced functions from &lt;EM&gt;'APICommon.c'&lt;/EM&gt; into and above the call to those functions in my &lt;EM&gt;'projectname.cpp'&lt;/EM&gt; and commenting these out of the &lt;EM&gt;'APICommon.c'&lt;/EM&gt; file.&amp;nbsp; My menu item now builds without error and executes as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I have to believe that my cut/paste/comment solution is not the path of least resistance.&amp;nbsp; Knowing that the placement/location of the function definition relative to the function call matters, is there a better way to accomplish this without having to resort to my cut/paste/comment solution?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again and thanks for the insight.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 16:29:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Updating-hotlinks-Examples-and-ClickAnElem/m-p/376873#M794</guid>
      <dc:creator>MudratDetector</dc:creator>
      <dc:date>2023-04-17T16:29:11Z</dc:date>
    </item>
  </channel>
</rss>

