Hi. I would like to know if there is any chance to get one object’s name or any other attributes?
I am trying to make a python script.
Thanks,
T.
Done it.
Glad you were able to achieve it! Please post your solution in order to have this thread be of use to other users of this forum.
import rhinoscriptsyntax as rs
import re as re
obj = rs.GetObjects(“Sel OBJs”)
NamesList = []
for i in obj:
name = rs.ObjectName(i)
NamesList.append(name)
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(text):
return [ atoi© for c in re.split(’(\d+)’, text) ]
NamesList.sort(key=natural_keys)
print(NamesList)
This code sorts the list alphabetically.
Sorry for the late answer, I didn’t open my pc since.