The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (Archicad API, BIMx API, BIMcloud API) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, Gordana Radonic, nbalogh, mnguyen, gkmethy, rmasaki, Viktor Kovacs, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy

By Lk_
#322260
Hello,
I have a library with some custom objects in it. Is there any way to command the add-on to display the 'Object Tool' window so the user can just pick the object and place it in the project? Also, if it's possible, can I highlight the contents of the library so the user would not have to look for it in the library tree?
#322750
So, I got the answer to the first question after extensive search and some outside help.
It turns out that I want to use ACAPI_Interface function like in the example from https://archicadapi.graphisoft.com/docu ... settingsid

However, the part where it says about filtering is unclear to me because I can't get it to work. Either the filtering is not working the way I would think or I'm doing something wrong.

Here's what I already have:
Code: Select all
void MyFunction(const uchar_t* name)
{
       API_LibPart part;
       BNZeroMemory(&part, sizeof(API_LibPart));
       lstrcpy(part.file_UName, name);
       GSErrCode err = ACAPI_LibPart_Search(&part, false);
 
       if (err == NoError)
       {
             API_ObjectSettingsPars api_objSetPars;
             BNZeroMemory(&api_objSetPars, sizeof(API_ObjectSettingsPars));

             api_objSetPars.elemDef.header.typeID = API_ObjectID;
             CHCopyC(part.ownUnID, api_objSetPars.subtypeID); 

             err = ACAPI_Interface(APIIo_ObjectSettingsID, &api_objSetPars);
 
             if (err == NoError)
             {
                   // do sth with the element
             }
       }
}
The window pops up but there's no filtering at all. It just shows everything that's in the whole library (chairs, tables and other decorative stuff).

Could someone help me from here, please?