Hi! I used a python script to batch exported 1000 obj files and I wonder when I do this script, whether it has a specific sequence or it’s randomly exported. I’m asking because I want to map the objects back with batch importing. Is it possible to find which object is with which indexes?
For batch export I use
objs = rs.AllObjects()
for i in range(len(objs)):
obj = objs[i]
filepath = dir + "/exported" + str(i) + ".obj"
rs.SelectObject(obj)
rs.Command("!_-Export \"" + filepath + "\" -Enter -Enter")
for batch import I use
for filepath in files:
index = filepath .split('exported')[1].split('.')[0]
rs.Command('_-Import ' + filepath + ' _Enter')
So the exported file has the same index as the imported file. But I couldn’t find out how to relate this index to the object SID or anything I can identify in rhino/grasshopper.
A second look I guess I’m asking when I select everything with objs = rs.AllObjects()
does rhino has a sequential coding for this selection.