<?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: How to distinguish between 3D views that have viewers and not in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13135913#M2197</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2268980"&gt;@christian.stan&lt;/a&gt;&amp;nbsp;Are you trying to refactor your code? If so, &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable?view=net-8.0" target="_blank" rel="noopener"&gt;System.Linq&lt;/A&gt; methods have you covered and can replace for/foreach loops.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var views3D = new FilteredElementCollector(doc).OfClass(typeof(View3D)).Cast&amp;lt;View3D&amp;gt;();
string mes = String.Join("\n", views3D.Select(v =&amp;gt; v.Name));
TaskDialog.Show("Revit info", mes);
string mes2 = String.Join("\n", views3D.Where(v =&amp;gt; v.Origin != null).Select(v =&amp;gt; v.Name));
TaskDialog.Show("Revit info", mes2);&lt;/LI-CODE&gt;&lt;P&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 10:14:03 GMT</pubDate>
    <dc:creator>sofia_feist</dc:creator>
    <dc:date>2024-11-07T10:14:03Z</dc:date>
    <item>
      <title>How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134091#M2191</link>
      <description>&lt;P&gt;I'm using a FilteredElementCollector to get all the 3D views in my project.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var views3D = new FilteredElementCollector(GlobalObjects.doc).OfClass(typeof(View3D)).Cast&amp;lt;View3D&amp;gt;();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This collector is returning all my 3D views, including a view that is not visible in my project browser. Trying to change the orientation of this invisible view (view3D.SetOrientation(viewOrientation3D)) is also returning an exception with the message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"View is missing its viewer."}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is this "Viewer" property that makes some 3D views visible in the Project Browser and editable, while other not? I can't really look up this view with Revit LookUp since I can't find it anywhere but debugging the findings of my collector shows me that this view does not have an Origin, SketchPlane or CropBox. Are those it?&amp;nbsp;How do I distinguish between 3D views that have viewers and 3D views that have not?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 16:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134091#M2191</guid>
      <dc:creator>sofia_feist</dc:creator>
      <dc:date>2024-11-06T16:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134286#M2192</link>
      <description>&lt;P&gt;Hello, There must be more effective, most certainly&lt;/P&gt;&lt;P&gt;I'm a beginner.&lt;/P&gt;&lt;P&gt;I have a problem with your GlobalObjects.doc&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var views3D = new FilteredElementCollector(doc).OfClass(typeof(View3D)).Cast&amp;lt;View3D&amp;gt;();
            String mes="";
            foreach (View3D v in views3D)
					{
						mes+="\n"+v.Name;
					}
            TaskDialog.Show("Revit info",mes);
            var queryview= from v in views3D where v.Origin != null select v;
            List&amp;lt;View3D&amp;gt; views3Dfiltered=queryview.ToList&amp;lt;View3D&amp;gt;();
            String mes2="";
            foreach (View3D v in views3Dfiltered)
					{
						mes2+="\n"+v.Name;
					}
            TaskDialog.Show("Revit info",mes2);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely&lt;BR /&gt;christian.stan&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 17:19:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134286#M2192</guid>
      <dc:creator>christian.stan</dc:creator>
      <dc:date>2024-11-06T17:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134394#M2193</link>
      <description>&lt;P&gt;Hello Cristian,&lt;/P&gt;&lt;P&gt;I'm not sure I understand what you're trying to do. Can you elaborate?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 18:16:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134394#M2193</guid>
      <dc:creator>sofia_feist</dc:creator>
      <dc:date>2024-11-06T18:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134491#M2194</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;I apply a collector like you but on my current document&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I scan the 3D views to extract the names&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I send these in a dialog box&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I create a blank View3d typed list&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I created a query that filters 3d views that do not have an origin&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I apply it &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I do another scan on my ecrete list &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I send this in a dialog box&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Sincerely&lt;/P&gt;&lt;P&gt;christian.stan&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 19:19:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134491#M2194</guid>
      <dc:creator>christian.stan</dc:creator>
      <dc:date>2024-11-06T19:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134738#M2195</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9301687"&gt;@sofia_feist&lt;/a&gt;&amp;nbsp; based on the limited code you've provided (more is always better to help with) im guessing you are getting view templates. to filter them out, change your code to this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var views3D = new FilteredElementCollector(GlobalObjects.doc).OfClass(typeof(View3D)).Cast&amp;lt;View3D&amp;gt;().Where(x=&amp;gt; x.IsTemplate == false);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Nov 2024 21:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13134738#M2195</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2024-11-06T21:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13135894#M2196</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6224381"&gt;@ctm_mka&lt;/a&gt;&amp;nbsp;Thank you for your answer! You are right! They were view templates. I thought View Templates would have a different datatype and not appear in my 3D view FilteredElementCollector.&lt;BR /&gt;&lt;BR /&gt;As for the code I shared, that was literally all I'm running and I was confused as to why I was getting views that were not visible in my Project Browser. Thanks for the clarification&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 10:03:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13135894#M2196</guid>
      <dc:creator>sofia_feist</dc:creator>
      <dc:date>2024-11-07T10:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13135913#M2197</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2268980"&gt;@christian.stan&lt;/a&gt;&amp;nbsp;Are you trying to refactor your code? If so, &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable?view=net-8.0" target="_blank" rel="noopener"&gt;System.Linq&lt;/A&gt; methods have you covered and can replace for/foreach loops.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var views3D = new FilteredElementCollector(doc).OfClass(typeof(View3D)).Cast&amp;lt;View3D&amp;gt;();
string mes = String.Join("\n", views3D.Select(v =&amp;gt; v.Name));
TaskDialog.Show("Revit info", mes);
string mes2 = String.Join("\n", views3D.Where(v =&amp;gt; v.Origin != null).Select(v =&amp;gt; v.Name));
TaskDialog.Show("Revit info", mes2);&lt;/LI-CODE&gt;&lt;P&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 10:14:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13135913#M2197</guid>
      <dc:creator>sofia_feist</dc:creator>
      <dc:date>2024-11-07T10:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish between 3D views that have viewers and not</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13136000#M2198</link>
      <description>&lt;P&gt;hi, no I was trying to answer your problem, but M.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6224381"&gt;@ctm_mka&lt;/a&gt;&amp;nbsp;code is much more synthetic thanks for the tip with System.Linq&lt;/P&gt;&lt;P&gt;Sincerely&lt;/P&gt;&lt;P&gt;christian.stan&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 10:53:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-distinguish-between-3d-views-that-have-viewers-and-not/m-p/13136000#M2198</guid>
      <dc:creator>christian.stan</dc:creator>
      <dc:date>2024-11-07T10:53:44Z</dc:date>
    </item>
  </channel>
</rss>

