<?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: Automatic Link library folder when loading add-on? How t in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158812#M6158</link>
    <description>&lt;BLOCKQUOTE&gt;Paodekcal wrote:&lt;BR /&gt;Do you have any idea? to fix code to work correctly at picture 2  That I don't want to run Libpart Function before.&lt;/BLOCKQUOTE&gt;
I don't fully understand what you are trying to do. I assume you want to be sure a specific library is loaded when your add-on carries out its primary function. I have 2 suggestions:&lt;UL&gt;&lt;LI&gt;1. Check whether the library is already loaded before you try to load it again. It is possible to load the same library twice, and ArchiCAD will complain of duplicate objects.&lt;BR /&gt;
&lt;BR /&gt;
2. Don't change the loaded libraries within &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Initialize&lt;E&gt;&lt;/E&gt;. Depending on the add-on type, it may be called before a project has been opened. I would wait until the library is actually required, e.g. the menu has been selected, before checking or changing the loaded libraries.&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Wed, 12 Jan 2011 09:10:35 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2011-01-12T09:10:35Z</dc:date>
    <item>
      <title>Automatic Link library folder when loading add-on? How to</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158808#M6154</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I want to auto link library when I load add-on &lt;BR /&gt;&lt;BR /&gt;I found this code &lt;BR /&gt;
&lt;PRE&gt;GSErrCode __ACENV_CALL	Initialize (void)
{

	GSErrCode err = ACAPI_Install_MenuHandler (32500, MenuCommandHandler);
	if (err != NoError)
		DBPrintf ("LibPart Test:: Initialize() ACAPI_Install_MenuHandler failed\n");
	IO::Location rab("E:/ArchiCAD Phase/Present ArchiCAD/Phase_9 16 พ.ย. - 31 ธ.ค. 53/All HRC OK/HRC_Object/");
	ACAPI_Environment (APIEnv_AddLibrariesID, reinterpret_cast&amp;lt;void *&amp;gt;(&amp;amp;rab), NULL);

	return NoError;
}		// Initialize&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;OK it's load all gsm file to my project.&lt;BR /&gt;&lt;BR /&gt;So I can use &lt;BR /&gt;
&lt;PRE&gt;CHANSI2Unicode("เข็มหกเหลี่ยมกลวง 15cm ยาว 3 เมตร.gsm", strlen("เข็มหกเหลี่ยมกลวง 15cm ยาว 3 เมตร.gsm"), part.file_UName, API_UniLongNameLen);  
	if((err = ACAPI_LibPart_Search(&amp;amp;part, false)) == NoError)   
	{ ... }&lt;/PRE&gt;
And it return no error&lt;BR /&gt;&lt;BR /&gt;But before I run ACAPI_LibPart_Search(&amp;amp;part, false) function I look at Library Part Manager&lt;BR /&gt;&lt;BR /&gt;It's don't show Folder That I link correctly below&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 08:30:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158808#M6154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-03T08:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158809#M6155</link>
      <description>You can see in this picture there is no library link.&lt;BR /&gt;
&lt;BR /&gt;
(It's have only default ArchiCAD Library)</description>
      <pubDate>Wed, 12 Jan 2011 04:45:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158809#M6155</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-12T04:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158810#M6156</link>
      <description>But after Libpart Function It's show!!</description>
      <pubDate>Wed, 12 Jan 2011 04:46:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158810#M6156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-12T04:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158811#M6157</link>
      <description>Do you have any idea? to fix code to work correctly at picture 2 &lt;BR /&gt;
&lt;BR /&gt;
That I don't want to run Libpart Function before.&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much</description>
      <pubDate>Wed, 12 Jan 2011 04:48:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158811#M6157</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-12T04:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158812#M6158</link>
      <description>&lt;BLOCKQUOTE&gt;Paodekcal wrote:&lt;BR /&gt;Do you have any idea? to fix code to work correctly at picture 2  That I don't want to run Libpart Function before.&lt;/BLOCKQUOTE&gt;
I don't fully understand what you are trying to do. I assume you want to be sure a specific library is loaded when your add-on carries out its primary function. I have 2 suggestions:&lt;UL&gt;&lt;LI&gt;1. Check whether the library is already loaded before you try to load it again. It is possible to load the same library twice, and ArchiCAD will complain of duplicate objects.&lt;BR /&gt;
&lt;BR /&gt;
2. Don't change the loaded libraries within &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Initialize&lt;E&gt;&lt;/E&gt;. Depending on the add-on type, it may be called before a project has been opened. I would wait until the library is actually required, e.g. the menu has been selected, before checking or changing the loaded libraries.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 12 Jan 2011 09:10:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158812#M6158</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-01-12T09:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158813#M6159</link>
      <description>I want to "Auto Link my folder library every time I create new project or open ArchiCAD"&lt;BR /&gt;
&lt;BR /&gt;
So the users don't have to link library folder by themself.&lt;BR /&gt;
&lt;BR /&gt;
Like the roofmaker or truss maker</description>
      <pubDate>Wed, 12 Jan 2011 09:25:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158813#M6159</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-12T09:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158814#M6160</link>
      <description>&lt;BLOCKQUOTE&gt;Paodekcal wrote:&lt;BR /&gt;I want to "Auto Link my folder library every time I create new project or open ArchiCAD"&lt;BR /&gt;
So the users don't have to link library folder by themself.&lt;BR /&gt;
Like the roofmaker or truss maker&lt;/BLOCKQUOTE&gt;
OK. I suggest using &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_Notify_CatchProjectEvent&lt;E&gt;&lt;/E&gt; so you can check if the necessary libraries have been loaded only when a project is opened or created.</description>
      <pubDate>Wed, 12 Jan 2011 09:29:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158814#M6160</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-01-12T09:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158815#M6161</link>
      <description>I found undirect solution.&lt;BR /&gt;
&lt;BR /&gt;
I create new default Archicad 14 template.&lt;BR /&gt;
&lt;BR /&gt;
It's easier</description>
      <pubDate>Wed, 12 Jan 2011 09:45:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158815#M6161</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-12T09:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Link library folder when loading add-on? How t</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158816#M6162</link>
      <description>&lt;BLOCKQUOTE&gt;it may be called before a project has been opened. &lt;/BLOCKQUOTE&gt;

Thank you.&lt;BR /&gt;
&lt;BR /&gt;
I think I can change Default Template is easier.&lt;BR /&gt;
&lt;BR /&gt;
I just realize from you say.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again</description>
      <pubDate>Wed, 12 Jan 2011 09:54:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Automatic-Link-library-folder-when-loading-add-on-How-to/m-p/158816#M6162</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-12T09:54:14Z</dc:date>
    </item>
  </channel>
</rss>

