<?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: Document.ActiveView is null in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3029320#M81772</link>
    <description>&lt;P&gt;Hi ollikat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help. Actually I try your idea to get all view with the ElementClassFilter, and in the collection I found the one I want, so I decide to debug when I lost this Document.Active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the reason is when I try to access it, the execution is in a BackgoundWorker...&lt;/P&gt;&lt;P&gt;Mystery is resolved, thank you again.&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2011 08:43:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-05-19T08:43:35Z</dc:date>
    <item>
      <title>Document.ActiveView is null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3028368#M81770</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is describe in the title.&lt;/P&gt;&lt;P&gt;I need to get only visible catagories in my external command, I can edit that in the panel "Visibility / Graphic Override for 3D View".&lt;/P&gt;&lt;P&gt;But to get this information I need a View. The only one I have is the Document.ActiveView but it is null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do somebody know how to know if a category is hidden ? or how to get this default 3d view ?&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2011 15:38:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3028368#M81770</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-18T15:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ActiveView is null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3029244#M81771</link>
      <description>&lt;P&gt;Think it's quite&amp;nbsp;odd that your ActiveView is null...API documentation says this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"The active view is the view that last had focus in the UI.&amp;nbsp;Null reference (Nothing in Visual Basic) if no view is considered active."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But shouldn't this be quite rare...?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, you can get all views with ElementClassFilter. After you have the correct view, you can use View::getVisibility(), as you propably have noticed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2011 05:37:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3029244#M81771</guid>
      <dc:creator>ollikat</dc:creator>
      <dc:date>2011-05-19T05:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ActiveView is null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3029320#M81772</link>
      <description>&lt;P&gt;Hi ollikat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help. Actually I try your idea to get all view with the ElementClassFilter, and in the collection I found the one I want, so I decide to debug when I lost this Document.Active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the reason is when I try to access it, the execution is in a BackgoundWorker...&lt;/P&gt;&lt;P&gt;Mystery is resolved, thank you again.&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2011 08:43:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3029320#M81772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-19T08:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ActiveView is null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3031798#M81773</link>
      <description>&lt;P&gt;May I ask you what you meant by &lt;EM&gt;"the execution is in a BackgroudWorker"&lt;/EM&gt;? Is it your background worker or someone else's? And one more question: From what place in your application you tried to access the UIDocument.ActiveView property when it returned NULL? I assume it was from not from an external command (not directly, anyway). Can you confirm that?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Arnošt Löbel&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2011 19:19:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3031798#M81773</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2011-05-20T19:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ActiveView is null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3047732#M81774</link>
      <description>&lt;P&gt;Hi Arnost,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean I used &lt;A target="_self" href="http://msdn.microsoft.com/fr-fr/library/system.componentmodel.backgroundworker%28VS.95%29.aspx"&gt;BackgroundWorker&lt;/A&gt; from System.dll for a long process.&lt;/P&gt;&lt;P&gt;And I accessed UIDocument.ActiveView﻿ from this class, who was created from an external command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope those precisions help you.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2011 12:38:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3047732#M81774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-06T12:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ActiveView is null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3047962#M81775</link>
      <description>&lt;P&gt;Hello NGOC:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calling the Revit API from other than the main thread is prohibited. Your application is supposed to finish all calls while it is still in the external command (or event, or updater, etc.). You can start a working thread from the command, but if you do, you cannot call the API back from that thread. Such calls have unexpected behavior and could (and as likely as not they would) cause Revit to throw exceptions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Arnošt Löbel&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2011 14:52:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/document-activeview-is-null/m-p/3047962#M81775</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2011-06-06T14:52:25Z</dc:date>
    </item>
  </channel>
</rss>

