Which is the best way to turn the Viewport into a XY plane 2D Viewport?

Using the below setting:

Viewport viewport = ViewportLayout.Viewports[<index>];

viewport.Camera.ProjectionMode = projectionType.Orthographic;
viewport.SetView(viewType.Top);
viewport.Rotate.Enabled = false;

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

3 comments
  • Hey,

    how can i hanlde this with Version 2021

    dosent Exists

    viewport.Rotate.Enabled = false;

    viewport.Camera.ProjectionMode = projectionType.Orthographic;

     

    thx

    Mario

    0
  • Hi Mario,

    Both the properties are still there.

    Maybe what you're calling viewport in your code, is a Model (or a ViewportLayout) instead.

    In this case, you can also try the below code:

    model1.ActiveViewport.Rotate.Enabled = false;
    model1.ActiveViewport.Camera.ProjectionMode = projectionType.Orthographic;
    1
  • thx works fine now

     

    0

Please sign in to leave a comment.