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
Ralph Wessel
Mentor
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