Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. unexpected token ' '

Hi all, I got an error as shown above , I am trying to create a python node which will give list elements with parameter which included in a defined list , in my case its special_rooms. IN[0] is rooms present the project and IN[1] is the all parameters present in the room category
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.

#elements
eList = IN[0]
#parameters
pList = IN[1]

Place your code below this line

special_rooms=[“inkomhal”,“nachthal+1”,“toilet”,“leefruimte”,“keuken”,“slaapkamer”,“dressing”,“bureel”,“badkamer”]
updatelist =

i=0

for e in UnwrapElement(pList):
for p in e:

    if p.Name == "Name" and p.Value in special_rooms:
        updatelist.append(eList[i])
i = i+1
# Assign your output to the OUT variable.

OUT = updatelist

1 Like

@Neel ,

i corrected a little pit… but i have still problems with the syntex

import clr
import sys

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
#elements
eList = IN[0]
#parameters
pList = IN[1]
#Place your code below this line

special_rooms= ['inkomhal','nachthal+1','toilet','leefruimte','keuken','slaapkamer','dressing','bureel','badkamer']
updatelist = []

i = 0

for e in UnwrapElement(pList):
	for p in e:
		if p.Name == "Name" and p.Value in special_rooms:
    		updatelist.append(eList[i])
    	
i = i+1
# Assign your output to the OUT variable.

OUT = updatelist
2 Likes

any ways thank you ,

corrected by don’t know is that what you need

import clr
import sys

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
#elements
eList = IN[0]
#parameters
pList = IN[1]
#Place your code below this line

special_rooms= ['inkomhal','nachthal+1','toilet','leefruimte','keuken','slaapkamer','dressing','bureel','badkamer']
updatelist = []

i = 0

for e in UnwrapElement(pList):
    for p in e:
        if p.Name == "Name" and p.Value in special_rooms:
            updatelist.append(eList[i])
    i = i+1

# Assign your output to the OUT variable.

OUT = updatelist
3 Likes

Thank you , now the program works just fine