BuildingCoder.CmdDimensionWallsFindRefs.Get3DView C# (CSharp) Method

Get3DView() private method

Return a 3D view from the given document.
private Get3DView ( Document doc ) : View3D
doc Document
return View3D
        private View3D Get3DView( Document doc )
        {
            FilteredElementCollector collector
            = new FilteredElementCollector( doc );

              collector.OfClass( typeof( View3D ) );

              foreach( View3D v in collector )
              {
            // skip view templates here because they
            // are invisible in project browsers:

            if( v != null && !v.IsTemplate && v.Name == "{3D}" )
            {
              return v;
            }
              }
              return null;
        }
CmdDimensionWallsFindRefs