Harness proD API Help
EPLAN.Harness.API.DataStructures Namespace / ViewsController Class / SaveCurrentView Method
Name of the saved view.
Example
In This Topic
    SaveCurrentView Method
    In This Topic
    Save current camera and visibility state.
    Syntax
    public View SaveCurrentView( 
       string name
    )

    Parameters

    name
    Name of the saved view.

    Return Value

    Saved view.
    Exceptions
    ExceptionDescription
    This file is not opened.
    Argument is null.
    Example
    This example shows how to save current camera and visibility state as new view. And how to assign this view to the desired mapped slot.
    // Get a graphic document.
    GraphicDocument document = GetDocument("Document");
    document.Open(false, false);
    					
    // Set the camera and visibility state of this document.
    					
    // Get the views controller.
    ViewsController views = document.Views;
    					
    // Save current view with name 'MyView'.
    View view = views.SaveCurrentView("MyView");
    					
    // At this moment you can find this view in the list of unmapped views.
    // View myView = views.UnmappedViews.First(v => v.Name == view.Name);
    
    // Map this view to slot 7.
    views.View7 = view;
    
    // Alternative method using collection of mapped views:
    // views.MappedViews[6] = view;
    
    // The view is stored in mapped slot 7 and no more in the list of unmapped views.
    
    // Save the document.
    document.Save();
    See Also