Steam Nodes tool.CreateEmptySheet needs updating

Hi devlopers!
I’m creating a workflow to copy a set of template views, organise them appropriately, (check, nailed it!) and also to copy a set of template sheets and insert the respective views onto those new sheets. However the project is Revit 21 and Dynamo 2.6 (my first time using this version) and I have noticed that there have been some updates to the syntax and the the create empty sheet from steam nodes needs to be updated accordingly. I took a couple cracks at it but was unable to solve all the issues.

Hopefully there’s a helpful soul out there who is familiar with the changes and can help me sort this node out!

Or even better if the Steam Nodes developer sees this and can update what’s necessary.

I’ve attached the screenshot of inside the broken node, as well as copied the python code for reference/adjustment.


#python nodes in dynamo 1.0
#proposed by Julien Benoit @jbenoit44
#http://aecuandme.wordpress.com/

#Credits for Traceback:
# Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

elt = []
names=[]
numbers=[]
sheets=[]
for i in IN[0]:
	elt.append(UnwrapElement(i).Id)
for i in IN[1]:
	names.append(UnwrapElement(i))
for i in IN[2]:
	numbers.append(UnwrapElement(i))

# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for i,n,u in zip(elt,names,numbers):
	try:
		errorReport = None
		a=ViewSheet.Create(doc,i)
		a.ViewName=n
		a.SheetNumber=u
		sheets.append(a.ToDSType(False))
	except:
		# if error accurs anywhere in the process catch it
		import traceback
		errorReport = traceback.format_exc()

# End Transaction
TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable
if errorReport == None:
	OUT = sheets
else:
	OUT = errorReport,sheets

@Konrad_K_Sobon

Thanks in advance!

The answer is here : https://forums.autodesk.com/t5/revit-api-forum/revit-2020-api-viewname-property-missing/td-p/8778941

As the python node use the deprecated ViewName property, you need to replace it by the Name property in the try statement.

1 Like

Hi @tyler.draftsman maybe try

Cheers