How to iterate through geometry polygons with Python API

Hello everyone

I need to iterate through the list of polygons of a geometry set, for then assign some values to extras.

I know that it can be done with geom.poly.list() FISH function via loop foreach, but I’m looking to do it in Python. The 9.2 software version includes Python API for geometry with new functions and classes, but there is no direct equivalent.

I asked this the new AI assistant, and it answered that I should use “itasca.geometry.poly.list()” function, which Itasca softwares do not recognize, and also it is not in the 9.2 version software documentation, therefore I assume it does not exist actually.

Thanks in advance for any input.
Regards,

-Leo

https://docs.itascacg.com/itasca920/common/docproject/source/manual/scripting/python/doc/itasca.geometry.html?node8610

take a look at this part of the documentation. It should be usefull

Hi Leo,
The list of polygons belongs to a geometry set object, so the syntax should be

for gset in it.geometry.list():
     for poly in gset.polys(): 
         ...
1 Like