License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

Archicad C++ API
About Archicad add-on development using the C++ API.

Problem with BAD_DATABASE

Anonymous
Not applicable
Basically I am working with AddOn that can synchronize layer/object configuration with external business application on APINotify_Open and APINotify_Save.

Most of the time everything works OK but from time to time I get APIERR_BADDATABASE on ACAPI_Attribute_GetNum and ACAPI_Element_GetNum.

Documentation provides very little information about this error. What could this error mean in this situation? What exactly can make the database not proper for these operations?
1 REPLY 1
Arunas wrote:
Most of the time everything works OK but from time to time I get APIERR_BADDATABASE on ACAPI_Attribute_GetNum and ACAPI_Element_GetNum.[...] What exactly can make the database not proper for these operations?
Perhaps you need to set the active database with APIDb_ChangeCurrentDatabaseID before calling ACAPI_Element_GetNum etc?
Ralph Wessel BArch
Central Innovation