Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Switch to 3D view through API

gunners6522
Participant
I would like the functionality in my add-on to switch database/window to a 3D View from the Project Navigator. I have tried to use APIDo_GoToViewID, with the guid of a NavigatorItem of type API_ProjectMap and API_PublicViewMap, but the function keeps returning APIERR_BADPARS. I have also tried parsing the guid to a const char*, but with no luck.

Is APIDo_GoToViewID even possible to use with 3D views or is it only drawings?

I have also taken a look at the Navigator_Test example, but it seems like a lot of work switching to the 3D model window and thereafter applying all the view settings (LayerCombinations, DrawingScale and so on...) of the NavigatorViewItem.

What is the simplest way of showing a 3D View in the 3D model window through the API?
2 REPLIES 2

Tibor Lorantfy
Advisor
Hi,

If you want to open a 3D window, not a specific 3D view, then these lines will do the trick for you:
API_WindowInfo newWindowInfo = {};
newWindowInfo.typeID = APIWind_3DModelID;
ACAPI_Automate (APIDo_ChangeWindowID, &newWindowInfo);

gunners6522
Participant
Hi, thanks for replying!

But if I want to switch to a specific 3D view, is this then possible? I can't seem to retrieve a database for a specific 3D view. The only way I've found is to apply the different viewsettings one by one, for whatever 3D context you are in. This however, seems a little overkill because I also have to reset the settings. Switching to the 3D window seems to open the most recent 3D view, but I would prefer not to tamper with any of the 3D views.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!