2 weeks ago
- last edited
2 weeks ago
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.
2 weeks ago
{
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.
2 weeks ago
Call ACAPI_Database_ChangeCurrentDatabase passing APIWind_3DModelID as the API_DatabaseInfo.typeID
2 weeks ago
- last edited
2 weeks ago
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?
2 weeks ago
{
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.
2 weeks ago
You can use also ACAPI_View_GoToView()
2 weeks ago
@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
2 weeks ago
Ok,I got it