## Layout.CreateViewFromDefinitionFile2

### Introduced

v11.0 (2013)

### Description

Creates a new View object given the path to its definition on disk. This method is similar to Layout.CreateViewFromDefinitionFile but specific to the python language.

### C# Syntax

    Object Layout.CreateViewFromDefinitionFile2( String in_pViewPath, String in_pViewName );

### Scripting Syntax

    oReturn = Layout.CreateViewFromDefinitionFile2( ViewPath, ViewName );

### Return Value

View

### Parameters

Parameter | Type | Description
--- | --- | ---
ViewPath | String | Complete path to a .xsitb or .xsivw file on disk.
ViewName | String | Required string providing the name of the view. Important: Blank characters found in the view name, such as space and tabs, are converted to underscores ("_").

### Examples

#### Python Example

    # Create a new Schematic view
    from siutils import *
    layout = Application.Desktop.ActiveLayout
    v = layout.CreateViewFromDefinitionFile2( r'$XSI_HOME\Application\views\schematicview.xsivw', 'My sv' )
    log( v.Nodes )

### See Also

Layout.CreateView2