Quantcast
Channel: ArchiCAD-Talk - Developer Forum
Viewing all articles
Browse latest Browse all 564

Create and change database to newly created db

$
0
0
Author:vuego
Posted: Wed Nov 11, 2015 6:30 pm (GMT+1)


When I try to switch current database to newly created worksheet, I get APIERR_BADDATABASE (The command cannot be executed on the current database). The worksheet is sucessfully created but changing database fails. What am I doing wrong here??

Code:

   GSErrCode               err;   
   API_DatabaseInfo         dbInfo;

   BNZeroMemory (&dbInfo, sizeof (API_DatabaseInfo));

   dbInfo.typeID = APIWind_WorksheetID;
   CHANSI2Unicode ("Det 1", (GS::Int32)strlen("Det 1"), dbInfo.name, API_UniLongNameLen);
   CHANSI2Unicode ("D10", (GS::Int32)strlen("D10"), dbInfo.ref, API_UniLongNameLen);

   if (ACAPI_Database (APIDb_NewDatabaseID, &dbInfo, NULL) == NoError) {
      err = ACAPI_Database (APIDb_ChangeCurrentDatabaseID, &dbInfo, NULL);
   }

_________________
ARCHICAD 18, Dell Studio i7, 8Gb Ram, Win7 64bit


Viewing all articles
Browse latest Browse all 564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>