Error " 'GeometryElement' object is not subscriptable"

Why do I get an error when I try to grab the first item from the list?


But if I use a regular Code Block, then everything works
Screenshot_2

Remove the last [0] in your solids line

solids=formExt[0].get_Geometry(Gopt)

Here you are geting the Geometry for the First Item in the List which will be the solid presumably.

Yes, but I don’t need a list, I just need the first element
If I remove [0], then I get a list of one element

OUT = solids[0]


Tried

Ok, now I see the “solids” variable is the actual solid itself, not a List item and that is why it won’t work.

Try this and see if it will work.

#Create a list first
solids = []
#Add the solid to that list
solids.append(formExt[0].get_Geometry(Gopt))
#Output the first item in the list
OUT = solids[0]