More of a Python problem than a Blender problem, really…
I have a group of objects in Blender. Each has many different properties (about 50) stored in a text file. I can select objects based on their properties without problems. However, what I really want to do is allow the user to choose which property they want to select by. The important bit of the code is :
for i in range(1,889): #888 lines in file line = infile.readline() Object,vcc,alfa,delta,mag,a,b,vel,dist,type.... = line.split() if float(type) >= float(Textbox2.val): for ob in gObjects: if ob.name.startswith(str(Object)): ob.select(1)
Where Textbox2.val is the value of, in this case, “type” to select the object by. gObjects is a list of all objects in Blender. I’ve tried replacing “float(type)” with “float(Parameter)” where Parameter is a string from another textbox, but I get “invalid literal for float(): type” as an error. Maybe there’s a better way to do this ?