Getting an error with select model elements

Hi,
i don’t know what is wrong when i change from select model element to elements i got an error , any idea? thanks in advanced

What is the error message?

image

i got this error in line 25

You went from a single element, to a list of elements. I am assuming you want to take each element from the list and run the code on it?

This error is telling you list doesn’t have geometry property. Python doesn’t have automatic lacing like Dynamo does, so it doesn’t know you want to pull the elements out of the list and get the geometry from them. As a result you have to code up your own loop.

There are a lot of good examples on how to do this in other forums online and on the forum.

As a start:

for elem in elems:
    *your code goes here
1 Like

image
this does pretty work, thank mate

i also have found a similar script has got the same loop so i used it to correct mine