Message 1 of 6
How to create a View without the Navisworks UI open (using the Command Line)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I am having an issue running my plugin through a command line. Specifically, I cannot find a way to create a View object without the Navisworks GUI open.
Here's a brief summary of what I'm trying to do:
- 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.
- For sectioning, I modify the ClippingPanes property of the document.ActiveView then I convert that View into a Viewport using view.CreateViewpointCopy()
- The plugin works perfectly when I run it from the Add-Ins tab in Navisworks.
- My goal is to run this plugin through the command line so I can automate the process for many models.
Here's the actual problem:
- When running the plugin through the command line using a .bat file, I get an issue when trying to section the viewpoint's View. Specifically: document.ActiveView is null (System.NullReferenceException). Evidently it's because the Navisworks GUI is not open during execution therefore there is no ActiveView.
- I cannot find a way to obtain or create a View object (not a Viewpoint object) without using document.ActiveView using the .NET API
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?
Any help is appreciated! Let me know if you need me to clarify anything.
Thanks in advance.