in 1, I created something like schedule column header with all the alphabet from A…Z,AA…AZ…etc
in 2, I am searching for A,C,D,K,L but the == node only returns me the first and last character
in 3, I am using use List.AllIndicesOf node to get all the true value. However, as it failed in 2, so the returned indices are in accurate
To clarify, in point 2, are you trying to return all the headers that contain A, B, C…L? If so, use String.Contains
Otherwise, tell us what is the result you want to obtain in point 2
I am working with the GetScheduleDataColumns node by BIMorph Node, and it only allows input as index. So what I wanna do is instead of me counting A=0, C=2, D=3, K = 10, L=11, I’d like to just input the alphabet of the column header.
So in point 2, I am looking to convert alphabet of the column header into its respective indices so I could feed it into the GetScheduleDataColumns node.
I have tried String.Contains and it is the same outcome as ==.
Hope I communicated my intention to you well
Thank you.
List.IndexOf with correct lacing should return the correct value. You may need to add one to that number, as it isn’t clear what the starting value should be.
This is what it says
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named string
Alright i believe you’re using Dynamo 1.3 version. You need to define the path of the string library. Try this:
import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
import string
alphabets = list(string.ascii_uppercase)
alphabets.extend([a+b for a in alphabets for b in alphabets])
search_keys = IN[0]
result = []
for sk in search_keys:
for idx, keys in enumerate(alphabets):
if sk == keys:
result.append(idx)
OUT = result
Hi @Kulkul I have got a solution by using Dynamo node, however I’d still be interested to know more about python in dynamo if you would explain what can I do to fix the Python script to make it works. Thank you