Changing the Library folder in ARCHICAD12
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-02-04
07:53 AM
- last edited on
2024-09-09
10:54 AM
by
Doreena Deng
2009-02-04
07:53 AM
Hi,
I want to change my project Libraries Folder in ArchiCAD 12.
I am using following function.
Void setupLibrariesForAC12()
{
API_LibrariesInfo libInfo;
memset(&libInfo, 0, sizeof(API_LibrariesInfo));
libInfo.nLib = 2;
libInfo.locations = (IO::Location**) BMAllocateHandle (libInfo.nLib * sizeof(IO::Location, ALLOCATE_CLEAR, 0);
libInfo.useSatellite = false;
new (*libInfo.locations) IO::Location (“C:\\Archicad12\\Archicad Library”);
new (*libInfo.locations + 1) IO::Location (“C:\\Archicad Development Library”);
ACAPI_Environment(APIEnv_SetLibrariesID, &libInfo, NULL);
(*libInfo.locations).~Location();
(*libInfo.locations + 1).~Location();
BMKillHandle(reinterpret_cast<GSHandle *> (&libInfo.locations));
}
But I am getting following errors
err LNK2001:unresolved external symbol “public: virtual class GS::ClassInfo * __thiscall GS::Object::GetClassInfoA(void)const “(?getClassInfoA@object@GS@@UBEPAVClassInfo@2@XZ)
fatal error LNK1120: 1 unresolved externals.
Please help me to solve these errors.
I want to change my project Libraries Folder in ArchiCAD 12.
I am using following function.
Void setupLibrariesForAC12()
{
API_LibrariesInfo libInfo;
memset(&libInfo, 0, sizeof(API_LibrariesInfo));
libInfo.nLib = 2;
libInfo.locations = (IO::Location**) BMAllocateHandle (libInfo.nLib * sizeof(IO::Location, ALLOCATE_CLEAR, 0);
libInfo.useSatellite = false;
new (*libInfo.locations) IO::Location (“C:\\Archicad12\\Archicad Library”);
new (*libInfo.locations + 1) IO::Location (“C:\\Archicad Development Library”);
ACAPI_Environment(APIEnv_SetLibrariesID, &libInfo, NULL);
(*libInfo.locations).~Location();
(*libInfo.locations + 1).~Location();
BMKillHandle(reinterpret_cast<GSHandle *> (&libInfo.locations));
}
But I am getting following errors
err LNK2001:unresolved external symbol “public: virtual class GS::ClassInfo * __thiscall GS::Object::GetClassInfoA(void)const “(?getClassInfoA@object@GS@@UBEPAVClassInfo@2@XZ)
fatal error LNK1120: 1 unresolved externals.
Please help me to solve these errors.
23 REPLIES 23
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-04-14 02:49 PM
2009-04-14
02:49 PM
I'm sorry, may be it's wrong topic.. Really I don't need to change Library folder. I need additional properties of project that can get via AutoText.
But I have the same linker error.
But I have the same linker error.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-07-24 07:56 AM
2009-07-24
07:56 AM
I have drawings in ArchiCAD 9.0 and I am opening those drawings in ArchiCAD 12.0.
I have two separate libraries for ArchiCAD 9.0 and 12.0. so, I am changing the library path in the drawing opening process by using apx.
I wrote the code as fallow
err = ACAPI_Environment(APIEnv_ChangeCurrLayerCombID, &attribHead.index, NULL, NULL); system was crashing.
I checked the values of variables in debug mode just before above line were.
attribHead.index = 74;
currentCombo = 76;
if remark the following lines in doopen()
Can any one give me some suggestions please?
I have two separate libraries for ArchiCAD 9.0 and 12.0. so, I am changing the library path in the drawing opening process by using apx.
I wrote the code as fallow
OSErr DoOpen() { HWND hwnd = FindWindow(NULL, "Library Loading Report"); if(hwnd) SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); SetupLibrariesForAC12(); // Changing the Library Path hwnd = FindWindow(NULL, "Library Loading Report"); if(hwnd) SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); if(SetLayerCombo("API-AllUnlockedAndShown")) // Set the layer combo. return noErr; else MessageBox(ACAPI_GetMainWindow(),"Problem to set layer Combo", " Tamawood Alert", MB_OK); } void SetupLibrariesForAC12() { API_LibrariesInfo libInfo; OSErr err; char libPath[MAX_PATH]; bool defaultFound = false; memset(&libInfo, 0, sizeof(API_LibrariesInfo)); err = ACAPI_Environment(APIEnv_GetLibrariesID, &libInfo, NULL); if(err != noErr) { MessageBox(ACAPI_GetMainWindow(), "ERROR:\n", "Tamawood Alert", MB_OK); return; } for(int ii = 0; ii < libInfo.nLib; ++ii) { strcpy(libPath, GetCPathFromLocation(&(*libInfo.locations)[ii])); if(stricmp(libPath, "C:\\Program Files\\Graphisoft\\ArchiCAD 12\\Tamawood Library 12") == 0) defaultFound = true; (*libInfo.locations)[ii].~Location(); } if(libInfo.location_Satellite) delete libInfo.location_Satellite; BMKillHandle (reinterpret_cast<GSHandle *> (&libInfo.locations)); if(!defaultFound) { memset(&libInfo, 0, sizeof(API_LibrariesInfo)); libInfo.nLib = 1; libInfo.locations = (IO::Location**) BMAllocateHandle (libInfo.nLib * sizeof (IO::Location), ALLOCATE_CLEAR, 0); libInfo.useSatellite = false; (*libInfo.locations)[0] = IO::Location("C:\\Program Files\\Graphisoft\\ArchiCAD 12\\Tamawood Library 12"); err = ACAPI_Environment(APIEnv_SetLibrariesID, &libInfo, NULL); if(err != noErr) MessageBox(ACAPI_GetMainWindow(), "ERROR:\n", "Tamawood Alert", MB_OK); BMKillHandle (reinterpret_cast<GSHandle *> (&libInfo.locations)); } } BOOL SetLayerCombo(char * pLayerCombo) { API_Attr_Head attribHead; OSErr err; short currentCombo; memset(&attribHead, 0, sizeof(API_Attr_Head)); strcpy(attribHead.name, pLayerCombo); attribHead.typeID = API_LayerCombID; attribHead.guid = APINULLGuid; err = ACAPI_Attribute_Search(&attribHead); if(err != noErr) { MessageBox(ACAPI_GetMainWindow(), "ERROR: Unable to find layer combo", "Tamawood Alert", MB_OK); return false; } currentCombo = 0; err = ACAPI_Environment(APIEnv_GetCurrLayerCombID, ¤tCombo, NULL, NULL); if(err != noErr || attribHead.index != currentCombo) { err = ACAPI_Environment(APIEnv_ChangeCurrLayerCombID, &attribHead.index, NULL, NULL); if(err != noErr) { MessageBox(ACAPI_GetMainWindow(), "ERROR: Unable to find layer combo", "Tamawood Alert", MB_OK); return false; } } return true; }It was successfully changing the Library path but, while changing the layer combo at the following line
err = ACAPI_Environment(APIEnv_ChangeCurrLayerCombID, &attribHead.index, NULL, NULL); system was crashing.
I checked the values of variables in debug mode just before above line were.
attribHead.index = 74;
currentCombo = 76;
if remark the following lines in doopen()
SetupLibrariesForAC12(); // Changing the Library Path hwnd = FindWindow(NULL, "Library Loading Report"); if(hwnd) SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);It works fine (if I am not changing the Library path).
Can any one give me some suggestions please?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-07-24 02:31 PM
2009-07-24
02:31 PM
Ranga wrote:Some thoughts:
I have two separate libraries for ArchiCAD 9.0 and 12.0. so, I am changing the library path in the drawing opening process by using apx.
if remark the following lines in doopen()SetupLibrariesForAC12(); // Changing the Library Path hwnd = FindWindow(NULL, "Library Loading Report"); if(hwnd) SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);It works fine (if I am not changing the Library path).
- 1) If you call
APIEnv_SetLibrariesID, the current list of loaded libraries will be entirely replaced by the list you specify. Your code will always reduce the list to a single item (the ArchiCAD 12 library).
2) Ákos has confirmed that you should also use placement new and delete to construct the list of library locations. This change might solve your problem
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-09-24 05:11 AM
2010-09-24
05:11 AM
Hi, we have a function in ArchiCAD 12. Which will change the library. And work ok.
Which is
New function is
Which is
void SetupLibrariesForAC12() { API_LibrariesInfo libInfo; OSErr err; char libPath[MAX_PATH]; bool defaultFound = false; memset(&libInfo, 0, sizeof(API_LibrariesInfo)); err = ACAPI_Environment(APIEnv_GetLibrariesID, &libInfo, NULL); if(err != noErr) { MessageBox(ACAPI_GetMainWindow(), "ERROR:\n", "Tamawood Alert", MB_OK); return; } for(int ii = 0; ii < libInfo.nLib; ++ii) { strcpy(libPath, GetCPathFromLocation(&(*libInfo.locations)[ii])); if(stricmp(libPath, "C:\\Program Files\\Graphisoft\\ArchiCAD 12\\Tamawood Library 12") == 0) defaultFound = true; (*libInfo.locations)[ii].~Location(); } if(libInfo.location_Satellite) delete libInfo.location_Satellite; BMKillHandle (reinterpret_cast<GSHandle *> (&libInfo.locations)); if(!defaultFound) { memset(&libInfo, 0, sizeof(API_LibrariesInfo)); libInfo.nLib = 1; libInfo.locations = (IO::Location**) BMAllocateHandle (libInfo.nLib * sizeof (IO::Location), ALLOCATE_CLEAR, 0); libInfo.useSatellite = false; (*libInfo.locations)[0] = IO::Location("C:\\Program Files\\Graphisoft\\ArchiCAD 12\\Tamawood Library 12"); err = ACAPI_Environment(APIEnv_SetLibrariesID, &libInfo, NULL); if(err != noErr) MessageBox(ACAPI_GetMainWindow(), "ERROR:\n", "Tamawood Alert", MB_OK); BMKillHandle (reinterpret_cast<GSHandle *> (&libInfo.locations)); } }Now I changed this function for ArchiCAD 13 and is not working.
New function is
void SetupLibrariesForAC13() { API_LibrariesInfo libInfo; OSErr err; char libPath[MAX_PATH]; bool defaultFound = false; memset(&libInfo, 0, sizeof(API_LibrariesInfo)); err = ACAPI_Environment(APIEnv_GetLibrariesID, &libInfo, NULL); if(err != noErr) { MessageBox(ACAPI_GetMainWindow(), "ERROR:\n", "Tamawood Alert", MB_OK); return; } for(int ii = 0; ii < libInfo.nLib; ++ii) { strcpy(libPath, GetCPathFromLocation(&(*libInfo.locations)[ii])); if(stricmp(libPath, "C:\\Program Files\\Graphisoft\\ArchiCAD 13\\Tamawood Library 13") == 0) defaultFound = true; (*libInfo.locations)[ii].~Location(); } if(libInfo.location_Satellite) delete libInfo.location_Satellite; BMKillHandle (reinterpret_cast<GSHandle *> (&libInfo.locations)); if(!defaultFound) { memset(&libInfo, 0, sizeof(API_LibrariesInfo)); libInfo.nLib = 1; libInfo.locations = (IO::Location**) BMAllocateHandle (libInfo.nLib * sizeof (IO::Location), ALLOCATE_CLEAR, 0); libInfo.useSatellite = false; (*libInfo.locations)[0] = IO::Location("C:\\Program Files\\Graphisoft\\ArchiCAD 13\\Tamawood Library 13"); err = ACAPI_Environment(APIEnv_SetLibrariesID, &libInfo, NULL); if(err != noErr) MessageBox(ACAPI_GetMainWindow(), "ERROR:\n", "Tamawood Alert", MB_OK); BMKillHandle (reinterpret_cast<GSHandle *> (&libInfo.locations)); } }And I noticed Location.hpp in InputOutput module is modified. Please any one give me any suggestions to change library.
- « Previous
- Next »
- « Previous
- Next »