Following this post https://forum.dynamobim.com/t/export-nwc-by-python/6744/6 I'm trying to do a similar thing but instead of exporting only the Active View, I'd like to extract a list of 3D views in different files.
I tweaked a bit the code in that post above but I'm still pretty new to Python so I guess there must be something pretty basic I'm missing there
This is the Dynamo graph:
And this is the script I'm using (modified from the script above)
from Autodesk.DesignScript.Geometry import *
Import ToDSType(bool) extension method
Import geometry conversion extension methods
Import DocumentManager and TransactionManager
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
coll = FilteredElementCollector(doc).OfClass(ProjectLocation)
output = 
views = [UnwrapElement(IN)]
views = (UnwrapElement(IN))
path = IN
name = IN
path = Autodesk.Revit.DB.FilePath(pathName)
OUT = views
for i in views:
Options = Autodesk.Revit.DB.NavisworksExportOptions()
Options.ExportScope = NavisworksExportScope.View
Options.ViewId = i.Id
#Expects ElementId (above)
Options.ExportLinks = True
doc.Export(path, name + i.Name , Options)
OUT = dir(Autodesk.Revit.DB.NavisworksExportOptions.ExportScope)
OUT = 0
I think now the script is getting the list of views in the input, but I'm still creating one file, now called "try1+the name of the view", while I actually want to create as many files as the views in the list that I input.
How do I make it create 1 file for each view I'm inputting?
Thanks a lot!
PS thanks @4bimfercesp for suggesting to create the new post!