thank you very much, i am an overwhelmed beginner still having trouble here…
for some reason the list.filterbyboolmask gives me 197 positions and the string.replace gives me only 8 positions back. I understand it probably comes from the list I created that contains 8 items to be searched, but i dont know how to solve the problem… I tried Cross Product and the string replace multiple but was not succesful either… Thank you very much!
Not an expert, but i think you should use List.Combine in addition to String.Replace. I proceed that way when I have an occurrence of a family on Revit of which I want to change multiple parameters.
Thanks… I kind of understand what happens but I dont know why or how to fix it again - looks better than before though! Revit didnt replace the items until number 7, that coincidentally has a string value “NUF_Shops”, the same as the 7. item of my list.create. Number 6 NUF-Mall wasnt replaced either…
Ok, unfortunately, couldn’t get to do it with only List.Combine, but here’s another way. A python way, like luca suggested, might be the best way to go
I tried to extend the list so that other strings get replaced as well and had to take the “else” part away, otherwise some strings would get duplicated, but it still works fine… I would be happy to know how to fix it though, just in case you have an idea…
I stumbled across this problem and this is my solution (using any and list comprehension):
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
list = IN[0]
newlist = []
specialCharacter=["(",")",";",","]
for a in list:
if any([x in a for x in specialCharacter]):
a=a.replace("(","")
a=a.replace(")","")
a=a.replace(",","")
a=a.replace(";","")
newlist.append(a)
else:
newlist.append(a)
OUT = newlist