cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
sxs
Booster

How to switch to 3d window by ACAPI?

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.

 

sxs_0-1748412849581.png

 

1 Solution

Accepted Solutions
sxs
Booster
{
		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.

Go to post

6 Replies 6

Call ACAPI_Database_ChangeCurrentDatabase passing APIWind_3DModelID as the API_DatabaseInfo.typeID

Ralph Wessel BArch
Central Innovation
sxs
Booster

sxs_1-1748500540076.png

 

This API still has no effect, but the return value is NoError. Is it related to my ArchiCad currently running DEMO status?

 

sxs_0-1748500445046.png

 

sxs
Booster
{
		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.

kolioi
Booster

You can use also ACAPI_View_GoToView()

 


@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

Ralph Wessel BArch
Central Innovation
sxs
Booster

Ok,I got it

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!