Views.Duplicate

Hello Everyone,

I’m trying to use the views.duplicate node from within a Python script node but it doesn’t seem to work any advice…

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

# Place your code below this line
views = IN[0]
count = IN[1]
names = IN[2]
out = []
x = 0
op = 'Duplicate'

for vie, num in zip(views,count):
	while num != 0:
		name = names[x]
		#out.append(Views.Duplicate(name,op))
		out.append(vie.Duplicate(name,op))
		num = num - 1
		x += 1
# Assign your output to the OUT variable.
OUT = out

Hello @gabdelmo

if you want to use Dynamo function, you need to import DSCore for DesignScript nodes to work and then use it

clr.AddReference("DSCoreNodes")
import DSCore
from DSCore import *

or you can also use the Revit API