Hi Konrad
Thank you for the reply.
Still not working as I get the following error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “<string>”, line 9, in <module>
IOError: System.IO.IOException: Could not add reference to assembly RevitServices
at IronPython.Runtime.ClrModule.AddReference(CodeContext context, String name)
at IronPython.Runtime.ClrModule.AddReference(CodeContext context, Object references)
at Microsoft.Scripting.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction
4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
at Microsoft.Scripting.SourceUnit.Execute(Scope scope)
at DSIronPython.IronPythonEvaluator.EvaluateIronPythonScript(String code, IList bindingNames, IList bindingValues)
Code as follows:
#Copyright © 2015 Konrad K Sobon
@arch_laboratory
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
Import Documment Manger and Transaction Manager
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocummentManager.Instance.CurrentDBDocument
#Import RevitAPI
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
elist = IN[0]
nameInput = str(IN[IN])
elements =
outList =
for i in range(0,len(elist)):
elements.append(UnwrapElement(elist[i]))
for i in elements:
eleType = doc.GetElement(i,GetTypeId())
params = eleType.Parameters
for i in params:
if i.Definition.name == nameImput:
outList.append(i.AsString())
else:
continue
#Assign your output to the OUT variable
OUT = outList</span>