title: Getting Active View Object Parameters?
body: <p>I am new to the API and I'm trying to get values from the active view.  I am using the following code as a mock up to what I'm trying to do:</p>
  
  <pre><code>public void GetViewProperties()
  {
    String viewname;
    String typename;
    String levelname;
    String Output;
  
    ViewFamilyType VfamType;
    Level lev;
  
    //Get document and current view
    Document doc = this.ActiveUIDocument.Document;
    View currentView = this.ActiveUIDocument.ActiveView;
  
    //Find the view family type that matches the active view
    VfamType = new FilteredElementCollector(doc).OfClass(typeof(ViewFamilyType))
      .Where(q =&gt; q.Name == "1-0-Model").First() as ViewFamilyType;
  
    //Find the level that matches the active view
    lev = new FilteredElementCollector(doc).OfClass(typeof(Level))
      .Where(q =&gt; q.Name == "00").First() as Level;
  
    //Get the view's current name
    viewname = currentView.Name.ToString();
  
    //Get the name of the view family type
    typename = VfamType.Name;
    //Get the name of the level
    levelname = lev.Name.ToString();
  
    //Combine results for task dialog
    Output = "View: " + viewname + "\n" + typename + "-" + levelname;
    //Show results
    TaskDialog.Show("View Properties Test",Output);
  }
  </code></pre>
  
  <p>I'm cheating at the moment by grabbing the view type and level by name.  I really want them to be found by looking at the properties of the active view.  I can't figure out how I am meant to access the view type and level name properties.  I need to make lambda use a variable e.g. (q => q.Name == Level.name), (q => q.Name == ViewFamilyType.name).</p>
  
  <p>Thanks in advance!</p>