<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: get 3d view with thelp of coding revit api in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8196192#M48350</link>
    <description>&lt;P&gt;You can enumerate all views, if you find a 3D View you can just select it into ActiveView. If you don't find one, you may have to create a new 3D View.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;View3D view3d;

using (var collector = FilteredElementCollector(document))
{
    view3d = collector
                    .OfClass(typeof(View3D))
                    .Cast&amp;lt;View3D&amp;gt;()
                    .FirstOrDefault();&lt;BR /&gt;    // Note: may want an intelligent predicate in the call to FirstOrDefault() depending on your needs
}

if (view3d == null)
{
    // Need to create the view
    // I don't think you will need this, since there is almost always a default 3d view, but if you do look for View3D.CreateIsometric API call
}

// Activate the 3d view
uiDocument.ActiveView = view3d;&lt;/PRE&gt;&lt;P&gt;Mark - Engineering at UpCodes&lt;/P&gt;&lt;P&gt;p.s. we are&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://up.codes/careers" target="_blank" rel="nofollow noopener noreferrer"&gt;hiring&lt;/A&gt;&amp;nbsp;- if you love building Revit addins&amp;nbsp;please reach out!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Aug 2018 17:28:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-13T17:28:00Z</dc:date>
    <item>
      <title>get 3d view with thelp of coding revit api</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8184651#M48348</link>
      <description>&lt;P&gt;i had imported an adsk model with the help of revit api but when the model is imported, its view is in 2dimensional view level1, i want that my code also set the view to 3d of the opened model, can someone please help? i had tried googling but the every next code i had tried produced some sorts of errors.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 09:40:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8184651#M48348</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-08T09:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: get 3d view with thelp of coding revit api</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8184902#M48349</link>
      <description>&lt;P&gt;even in the view section,i m having only floor ceiling and elevation view...to view it as 3d box, i manually have to go to view tab and then click on default on 3d but i want to do it through my code so please if someone can help.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 11:38:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8184902#M48349</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-08T11:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: get 3d view with thelp of coding revit api</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8196192#M48350</link>
      <description>&lt;P&gt;You can enumerate all views, if you find a 3D View you can just select it into ActiveView. If you don't find one, you may have to create a new 3D View.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;View3D view3d;

using (var collector = FilteredElementCollector(document))
{
    view3d = collector
                    .OfClass(typeof(View3D))
                    .Cast&amp;lt;View3D&amp;gt;()
                    .FirstOrDefault();&lt;BR /&gt;    // Note: may want an intelligent predicate in the call to FirstOrDefault() depending on your needs
}

if (view3d == null)
{
    // Need to create the view
    // I don't think you will need this, since there is almost always a default 3d view, but if you do look for View3D.CreateIsometric API call
}

// Activate the 3d view
uiDocument.ActiveView = view3d;&lt;/PRE&gt;&lt;P&gt;Mark - Engineering at UpCodes&lt;/P&gt;&lt;P&gt;p.s. we are&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://up.codes/careers" target="_blank" rel="nofollow noopener noreferrer"&gt;hiring&lt;/A&gt;&amp;nbsp;- if you love building Revit addins&amp;nbsp;please reach out!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 17:28:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-3d-view-with-thelp-of-coding-revit-api/m-p/8196192#M48350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-13T17:28:00Z</dc:date>
    </item>
  </channel>
</rss>

