Hello,
I’m attempting to use Konrad’s archi-lab node called Revision Properties. My dynamo (dynamo 1.2/Revit2015) doesn’t see the node when I install the package.
Per http://archi-lab.net/revisions-on-sheet-w-dynamo/
It’s supposed to be used as so:
There is code provided on how to use the node, yet I cannot figure out how I would use the code. Obviously, by inserting the code into a custom python script I get errors and the naming of the inputs and outputs does not match.
How would you go about creating this node?
It looks like it is python code:
# 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)
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
def ProcessList(_func, _list):
return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list )
def UnwrapNestedList(e):
return UnwrapElement(e)
def GetSequence(e):
return e.SequenceNumber
def GetDate(e):
return e.RevisionDate
def GetIssuedTo(e):
return e.IssuedTo
def GetIssuedBy(e):
return e.IssuedBy
def GetIssued(e):
return e.Issued
def GetDescription(e):
return e.Description
if isinstance(IN[0], list):
revs = ProcessList(UnwrapNestedList, IN[0])
else:
revs = [UnwrapElement(IN[0])]
try:
errorReport = None
sequence = ProcessList(GetSequence, revs)
date = ProcessList(GetDate, revs)
description = ProcessList(GetDescription, revs)
issued = ProcessList(GetIssued, revs)
issuedTo = ProcessList(GetIssuedTo, revs)
issuedBy = ProcessList(GetIssuedBy, revs)
except:
# if error accurs anywhere in the process catch it
import traceback
errorReport = traceback.format_exc()
#Assign your output to the OUT variable
if errorReport == None:
OUT = [sequence, date, description, issued, issuedTo, issuedBy]
else:
OUT = errorReport