Automatic Link library folder when loading add-on? How to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12
05:43 AM
- last edited on
2023-08-03
10:30 AM
by
Doreena Deng
I found this code
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<void *>(&rab), NULL); return NoError; } // Initialize
OK it's load all gsm file to my project.
So I can use
CHANSI2Unicode("เข็มหกเหลี่ยมกลวง 15cm ยาว 3 เมตร.gsm", strlen("เข็มหกเหลี่ยมกลวง 15cm ยาว 3 เมตร.gsm"), part.file_UName, API_UniLongNameLen); if((err = ACAPI_LibPart_Search(&part, false)) == NoError) { ... }And it return no error
But before I run ACAPI_LibPart_Search(&part, false) function I look at Library Part Manager
It's don't show Folder That I link correctly below
- Labels:
-
Add-On (C++)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 05:45 AM
(It's have only default ArchiCAD Library)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 05:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 05:48 AM
That I don't want to run Libpart Function before.
Thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 10:10 AM
Paodekcal wrote: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:
Do you have any idea? to fix code to work correctly at picture 2 That I don't want to run Libpart Function before.
- 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.
2. Don't change the loaded libraries withinInitialize. 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.
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 10:25 AM
So the users don't have to link library folder by themself.
Like the roofmaker or truss maker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 10:29 AM
Paodekcal wrote:OK. I suggest using
I want to "Auto Link my folder library every time I create new project or open ArchiCAD"
So the users don't have to link library folder by themself.
Like the roofmaker or truss maker
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 10:45 AM
I create new default Archicad 14 template.
It's easier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-01-12 10:54 AM
it may be called before a project has been opened.Thank you.
I think I can change Default Template is easier.
I just realize from you say.
Thanks again