No problem. If you want to see a really complicated version, here are two others that work, one using an embedded for loop and the other using a lambda function inside an embedded for loop
# Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net
import clr
# Import Element wrapper extension methods
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# 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)
revisions = UnwrapElement(IN[0])
sheets = UnwrapElement(IN[1])
Output = []
for sheet, revision in zip(sheets, revisions):
revnum = [Autodesk.Revit.DB.ViewSheet.GetRevisionNumberOnSheet(sheet, rev.Id) for rev in revision]
Output.append(revnum)
OUT = Output
Lambda:
import clr
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
revisions = UnwrapElement(IN[0])
sheets = UnwrapElement(IN[1])
f = lambda sht, revi : [Autodesk.Revit.DB.ViewSheet.GetRevisionNumberOnSheet(sht, rev.Id) for rev in revi]
OUT = [f(sheet, revision) for sheet, revision in zip(sheets, revisions)]
Although @jacob.small would say it would be better to not make it iterate in a list, just use the simple Autodesk.Revit.DB.ViewSheet.GetRevisionNumberOnSheet(UnwrapElement(IN[0]), UnwrapElement(IN[1]).Id) in a python node, put it into a custom node where the inputs are regulated to a single item, and let levels and lacing do the work for you.
Just out of courisity
Would it make a difference if Revisions in Revit is set per Sheet / per Project?
Would it make a difference if there where dependant views with the revisions clouds on the Views?
Would it make a difference if Revision Clouds are on the Sheets?
I suspect that you can pull other info from Revision clouds, but I always have a Revision ticked in ‘Revisions on Sheet’ incase (when) someone deletes the cloud.
I would never put revisions on views incase (when) they get clipped and/or accidently copied from view to view.
Hey, yes it would, but from a personal point of view it is a solid workflow.
Other people might have different workflows
I think the major problem is the need for a custom parameter everytime you have a new revision. You’d want to add an auto parameter create as part of the graph and I don’t know how Revit would respond to having 2000 shared parameters in the sheet properties. I guess the OP will find out
I would generate an Excel, but the OP wanted it entirely in Revit and as a Parameter… Hence the need for a parameter to match every revision… Then the dynamo populates the parameters correctly.
Over the course of (5 years?) a GA plan might get issued 30 times… I wouldn’t sack someone personally, but I can see how it would focus your employees on early coordination and getting it right!