2025-05-28
08:14 AM
- last edited on
2025-05-29
01:56 PM
by
Laszlo Nagy
Hi,everyone:
GSErrCode err = ACAPI_Sight_SelectSight (nullptr, &origSight);
if (err != NoError) {
ErrorBeep ("Cannot switch to the 3D sight", err);
return err;
}
I try this to switch to the 3d window, but it does not work.
Solved! Go to Solution.
2025-05-29 11:01 AM
{
API_WindowInfo windowInfo;
API_DatabaseInfo origDB, planDB;
API_Element element;
GS::Array<API_Guid> elemList;
GSErrCode err;
BNZeroMemory(&planDB, sizeof(API_DatabaseInfo));
planDB.typeID = APIWind_3DModelID;
//ACAPI_Database(APIDb_GetCurrentDatabaseID, &origDB, nullptr);
ACAPI_Database_ChangeCurrentDatabase(&planDB);
//
BNZeroMemory(&windowInfo, sizeof(API_WindowInfo));
windowInfo.typeID = APIWind_3DModelID;
windowInfo.databaseUnId = planDB.databaseUnId;
err = ACAPI_Window_ChangeWindow(&windowInfo);
}
this can work.
2025-05-28 01:43 PM
Call ACAPI_Database_ChangeCurrentDatabase passing APIWind_3DModelID as the API_DatabaseInfo.typeID
2025-05-29
08:36 AM
- last edited on
2025-05-29
01:56 PM
by
Laszlo Nagy
This API still has no effect, but the return value is NoError. Is it related to my ArchiCad currently running DEMO status?
2025-05-29 11:01 AM
{
API_WindowInfo windowInfo;
API_DatabaseInfo origDB, planDB;
API_Element element;
GS::Array<API_Guid> elemList;
GSErrCode err;
BNZeroMemory(&planDB, sizeof(API_DatabaseInfo));
planDB.typeID = APIWind_3DModelID;
//ACAPI_Database(APIDb_GetCurrentDatabaseID, &origDB, nullptr);
ACAPI_Database_ChangeCurrentDatabase(&planDB);
//
BNZeroMemory(&windowInfo, sizeof(API_WindowInfo));
windowInfo.typeID = APIWind_3DModelID;
windowInfo.databaseUnId = planDB.databaseUnId;
err = ACAPI_Window_ChangeWindow(&windowInfo);
}
this can work.
2025-05-29 11:19 AM
You can use also ACAPI_View_GoToView()
2025-05-29 12:19 PM
@sxs wrote:This API still has no effect, but the return value is NoError. Is it related to my ArchiCad currently running DEMO status?
When you say it has no effect, do you mean you don't see the view come to the front? If so, this isn't what ACAPI_Database_ChangeCurrentDatabase does. It makes the 3D window the current database for all following API commands that concern a specific database, e.g. ACAPI_View_Rebuild
If you simply want to bring the view to the front, use ACAPI_Window_ChangeWindow, but I don't think that's what you want to do in the context of a notification handler
2025-05-30 03:31 AM
Ok,I got it