Hello there,
I would like to know how do I select the sub-object of an object with Python? Let's say we have an interface called Interface_1, which intersects two different soils thus dividing the interface into Interface_1_1 and Interface_1_2. My doubt is: with Python, how do I select Interface_1_2 and then take results from it? I know how to do it for the global interface: <<g_o.getresults(g_o.Interfaces[i], phase_o, g_o.ResultTypes.Interface.InterfaceEffectiveNormalStress, "node") >> but I would like to take the results only for Interface_1_2, how am I supposed to do it with Python?
With my best regards,
Afonso Anjos
Dear Afonso,
In Output the group of g_o.Interfaces[] contains all interface objects. To access the first item of the list indeed you can use the indexing for lists, so:
g_o.Interfaces[i]
To go deeper into the list of lists, you can add an extra index:
g_o.Interfaces[i][j]
That should do it.
Answer Verified By: Afonso Anjos
Thank you very much, Stefanos! That was exactly what I was looking for =)