APIDb_GetCurrentDatabaseID problem/bug?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-18
03:52 AM
- last edited on
2023-08-07
11:31 AM
by
Doreena Deng
2006-01-18
03:52 AM
Hello,
I cannot find out which section database I am using on the open notification. I get this problem in both ArchiCAD 9 and ArchiCAD 7.
To replicate this problem I have a simple test. dbUnid and dbIndex are both set from a section that is in the drawing.
APIDatabaseInfo newDB;
memset(&newDB, 0, sizeof(APIDatabaseInfo));
newDB.typeID = APIWindSectionID;
#if ACNINE
newDB.databaseUnId = dbUnid;
#else
newDb.index = dbIndex;
#endif
err = ACAPI_Database(APIDb_ChangeCurrentDatabaseID, &newDB, nil);
// can use the section database ok
memset(&newDB, 0, sizeof(APIDatabaseInfo));
err = ACAPI_Database(APIDb_GetCurrentDatabaseID, &newDB, nil);
// now I cannot get the current database. err == noErr, but...
// newDB.typeID == APIWindSectionID
// newDB.index == 0
// newDB.databaseUnId.id1 == 0
// newDB.databaseUnId.id2 == 0
Is this a bug? I'd like to know what database I just changed to without having to remember myself.
Thanks,
Adam
I cannot find out which section database I am using on the open notification. I get this problem in both ArchiCAD 9 and ArchiCAD 7.
To replicate this problem I have a simple test. dbUnid and dbIndex are both set from a section that is in the drawing.
APIDatabaseInfo newDB;
memset(&newDB, 0, sizeof(APIDatabaseInfo));
newDB.typeID = APIWindSectionID;
#if ACNINE
newDB.databaseUnId = dbUnid;
#else
newDb.index = dbIndex;
#endif
err = ACAPI_Database(APIDb_ChangeCurrentDatabaseID, &newDB, nil);
// can use the section database ok
memset(&newDB, 0, sizeof(APIDatabaseInfo));
err = ACAPI_Database(APIDb_GetCurrentDatabaseID, &newDB, nil);
// now I cannot get the current database. err == noErr, but...
// newDB.typeID == APIWindSectionID
// newDB.index == 0
// newDB.databaseUnId.id1 == 0
// newDB.databaseUnId.id2 == 0
Is this a bug? I'd like to know what database I just changed to without having to remember myself.
Thanks,
Adam
Labels:
- Labels:
-
Add-On (C++)
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-19 10:58 PM
2006-01-19
10:58 PM
adambutler wrote:Adam,
I'd like to know what database I just changed to without having to remember myself.
How about using APIDb_GetCurrentDatabaseID to tell you which one is active? E.g.
API_DatabaseInfo dbase; ACAPI_Database(APIDb_GetCurrentDatabaseID, &dbase, 0);
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
2006-01-20 03:37 AM
2006-01-20
03:37 AM
My problem is with APIDb_GetCurrentDatabaseID. It tells me that its a section database but I cannot tell which section because the index/id's are zero.
As a workaround I am now using a global variable to tell which database I last changed to.
As a workaround I am now using a global variable to tell which database I last changed to.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-01-20 10:56 AM
2006-01-20
10:56 AM
adambutler wrote:Oops - didn't read the question properly
My problem is with APIDb_GetCurrentDatabaseID. It tells me that its a section database but I cannot tell which section because the index/id's are zero.

I've checked the instances where I use APIDb_GetCurrentDatabaseID and I get non-zero values. Perhaps the results are dependent on the context in which the call is made?
Ralph Wessel BArch
Central Innovation
Central Innovation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-02-23 01:06 AM
2006-02-23
01:06 AM
Adam,
I use "ACAPI_Automate (APIDo_ChangeWindowID, &windowInfo, NULL);" instead to change to a section/elevation window. It seems working ok.
HTH,
Hoa
I use "ACAPI_Automate (APIDo_ChangeWindowID, &windowInfo, NULL);" instead to change to a section/elevation window. It seems working ok.
HTH,
Hoa