<?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 create a View without the Navisworks UI open (using the Command Line) in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371834#M66</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13896305"&gt;@Tobias-san&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Could you please share a simple, non-confidential sample file so I can analyze the issue on my end?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 18:53:25 GMT</pubDate>
    <dc:creator>naveen.kumar.t</dc:creator>
    <dc:date>2025-03-14T18:53:25Z</dc:date>
    <item>
      <title>How to create a View without the Navisworks UI open (using the Command Line)</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13369875#M63</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having an issue running my plugin through a &lt;U&gt;&lt;STRONG&gt;command line&lt;/STRONG&gt;&lt;/U&gt;&lt;STRONG&gt;.&amp;nbsp;&lt;/STRONG&gt;Specifically, &lt;U&gt;I cannot find a way to create a &lt;STRONG&gt;View &lt;/STRONG&gt;object without the Navisworks GUI open.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's a brief summary of what I'm trying to do:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have written a plugin that allows me to generate and save a list of viewpoints for a series of items all around the model. Each viewpoint zooms into the items and uses Box Sectioning to only show the relevant area.&lt;/LI&gt;&lt;LI&gt;For sectioning, I modify the ClippingPanes property of the&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;document.ActiveView&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;then I convert that View into a Viewport using &lt;U&gt;&lt;STRONG&gt;view.CreateViewpointCopy()&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/LI&gt;&lt;LI&gt;The plugin works perfectly when I run it from the Add-Ins tab in Navisworks.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;My goal is to run this plugin through the command line&amp;nbsp;so I can automate the process for many models.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's the actual problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When running the plugin &lt;U&gt;&lt;STRONG&gt;through the command line using a .bat file&lt;/STRONG&gt;&lt;/U&gt;,&amp;nbsp;I get an issue when trying to section the viewpoint's View. Specifically:&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;document.ActiveView&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;is null&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;(System.NullReferenceException). Evidently it's because the Navisworks GUI is not open during execution therefore there is no ActiveView.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;&lt;STRONG&gt;I cannot find a way to obtain or create a View object (not a Viewpoint object) without using document.ActiveView using the .NET API&lt;/STRONG&gt;&lt;/U&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe there is a solution using the COM API? Or perhaps there is a way to obtain a View without using document.ActiveView? Or to apply Box Sectioning for a Viewpoint without using a View object?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated! Let me know if you need me to clarify anything.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 20:28:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13369875#M63</guid>
      <dc:creator>Tobias-san</dc:creator>
      <dc:date>2025-03-13T20:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a View without the Navisworks UI open (using the Command Line)</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371287#M64</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13896305"&gt;@Tobias-san&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="83" data-end="187"&gt;The behavior you are experiencing is expected. If no UI is open, &lt;CODE data-start="148" data-end="169"&gt;document.ActiveView&lt;/CODE&gt; will be &lt;CODE data-start="178" data-end="184"&gt;null&lt;/CODE&gt;.&lt;/P&gt;
&lt;P data-start="189" data-end="213"&gt;Here is my suggestion:&lt;/P&gt;
&lt;OL data-start="214" data-end="631"&gt;
&lt;LI data-start="214" data-end="377"&gt;Create viewpoints for each object by zooming into the items and using Box Sectioning to display only the relevant area, then add them to the saved viewpoints.&lt;/LI&gt;
&lt;LI data-start="378" data-end="411"&gt;Access each saved viewpoint.&lt;/LI&gt;
&lt;LI data-start="412" data-end="461"&gt;Use &lt;CODE data-start="419" data-end="430"&gt;doc.Views&lt;/CODE&gt; instead of &lt;CODE data-start="442" data-end="458"&gt;doc.ActiveView&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI data-start="462" data-end="502"&gt;Retrieve the view from &lt;CODE data-start="488" data-end="499"&gt;doc.Views&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI data-start="503" data-end="555"&gt;Apply each viewpoint to the corresponding view.&lt;/LI&gt;
&lt;LI data-start="556" data-end="631"&gt;I accessed the clipping planes and exported the data as a &lt;CODE data-start="617" data-end="623"&gt;.txt&lt;/CODE&gt; file.&lt;BR /&gt;&lt;BR /&gt;&lt;LI-CODE lang="csharp"&gt;Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
SavedViewpoint savedViewpoint = doc.SavedViewpoints.Value.Where(savedItem =&amp;gt; !savedItem.IsGroup &amp;amp;&amp;amp; savedItem.DisplayName.Contains("MyViewPointName")).First() as SavedViewpoint;               
if(savedViewpoint!=null)
{                   
    View myView = doc.Views[0];
    myView.CopyViewpointFrom(savedViewpoint.Viewpoint,ViewChange.Navigation);
    string output=myView.GetClippingPlanes();
    using(StreamWriter writer=new StreamWriter(@"C:\Users\FileName.txt"))
    {
        writer.WriteLine(output);
        writer.Close();
    } 
}​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 14 Mar 2025 13:41:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371287#M64</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2025-03-14T13:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a View without the Navisworks UI open (using the Command Line)</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371514#M65</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5661631"&gt;@naveen.kumar.t&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, doc.Views[0] will not work either.&lt;/P&gt;&lt;P&gt;The list is empty when running it through the command line. Therefore using doc.Views[0] gives me an Index out of Range exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(As a side note, I am aware that I could run the command using -ShowGui switch to open Navisworks during execution but I would like to avoid that if possible)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 15:38:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371514#M65</guid>
      <dc:creator>Tobias-san</dc:creator>
      <dc:date>2025-03-14T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a View without the Navisworks UI open (using the Command Line)</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371834#M66</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13896305"&gt;@Tobias-san&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Could you please share a simple, non-confidential sample file so I can analyze the issue on my end?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13371834#M66</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2025-03-14T18:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a View without the Navisworks UI open (using the Command Line)</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13375249#M67</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5661631"&gt;@naveen.kumar.t&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a simplified example of what my code does. The two functions that I use are SetClippingPlanes() and CreateViewpointCopy(). Both require me to have a valid View object first.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;try {
    Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
    Autodesk.Navisworks.Api.View view;

    //Choose one here.
    view = doc.ActiveView;
    view = doc.Views[0];

    //Here I would modify the sectionning of the view using SetClippingPlanes()

    //Convert the view back to a viewpoint so I can save it.
    Viewpoint vp = view.CreateViewpointCopy();
    MessageBox.Show("Success!");
catch (Exception ex){
    MessageBox.Show(ex.ToString());
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I build this function using an &lt;U&gt;AddInPlugin&lt;/U&gt;. Then I use the following .bat file to execute it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;set navispath=(Your roamer.exe path here)
set inputfile=(Your input file here)
set outputfile=(Your output file here)

call %navispath% -ExecuteAddInPlugin "PluginName.PluginCode" -nwd %outputfile% %inputfile%&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you need anything else&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 13:38:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13375249#M67</guid>
      <dc:creator>Tobias-san</dc:creator>
      <dc:date>2025-03-17T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a View without the Navisworks UI open (using the Command Line)</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13378803#M68</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13896305"&gt;@Tobias-san&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="0" data-end="76"&gt;I escalated your issue to the Navisworks Engineering team for their input.&lt;/P&gt;
&lt;P data-start="78" data-end="176" data-is-last-node="" data-is-only-node=""&gt;According to them, accessing Views without a GUI is unlikely, as Views are not explicitly created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 08:46:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/how-to-create-a-view-without-the-navisworks-ui-open-using-the/m-p/13378803#M68</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2025-03-19T08:46:32Z</dc:date>
    </item>
  </channel>
</rss>

