Change view perspective with code

Change view perspective with code

julio_r
Not applicable
156 Views
5 Replies
Message 1 of 6

Change view perspective with code

julio_r
Not applicable

[ FlexSim 18.0.2 ]

Hello,

I´m trying to make a simple code that replicate de effect on clicking on the save views name in the Quick properties when we click on the model floor.

10668-asdf.png

Is there a command or a different way to accomplish this?

0 Likes
Accepted solutions (1)
157 Views
5 Replies
Replies (5)
Message 2 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution
string viewName = "View 1";
applicationcommand("changeperspview", viewName, activedocumentnode());


Matthew Gillespie
FlexSim Software Developer

Message 3 of 6

julio_r
Not applicable

Thank you so much, that's exactly what I needed.

0 Likes
Message 4 of 6

nmzenke
Enthusiast
Enthusiast

This works well running in the script window if the 3D view is already the selected window. Is there a way to make this work when some non-3D window is active? For example, I want someone to be able to push a button (run the code in the onPress) on a dashboard and have the model open up a 3D window in the specified view.

@Matthew Gillespie

0 Likes
Message 5 of 6

Matthew_Gillespie
Autodesk
Autodesk

This answer shows you how to loop through all open 3D views.

To open a new 3D view you can use this command:

treeenode newView = applicationcommand("perspectiveview"); 

Either way you just replace activedocumentnode() with your chosen view.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 6 of 6

nmzenke
Enthusiast
Enthusiast

That worked great. Thanks!

0 Likes