Hey guys,
I'm now working on a small case where a plate in inserted in two layers of soil. The soil and plate models are also imported from .dxf file.
The plate is imported as a whole line and I created the plate as well as the interfaces as a whole line, in the script below:
The plate and the interfaces are stored in their own list "plates[]" and "posinterfaces[]"/"neginterfaces[]". But when it comes to the staged construction, the plate and interfaces are split by the soil layer
I can't really use the posinterfaces[] or plates[] to activate the plate and the interfaces, as shown in the script here. Instead, I have to use the two commented lines to activate the plate and the interfaces.
Got two questions here:
1. How can I use the plate[] and posinterfaces[] lists that I create myself to activate these elements in the staged construction? Do I have to use g_i.Plates? Or is there a smarter way to realise what I want here? The reason I want to use self-created lists is such that I can activate only the elements I want to activate without having to know their id in g_i.Plates when there are more plates in the model (the example I show here is very simple). Say, if I have two plates, then I know the order they are saved in my list "plates[]". But if I have to use g_i.Plates, I'll have to first know which is saved in which g_i.Plates[1?2?...]
2. Didn't find in the mannual how can I activate for example only positive interfaces? Because if I use g_i.Interfaces, it's all interfaces. Is there anything like g_i.PosInterfaces?
Thanks a lot in advance!
Hello Xuyan Liu,
Your question has multiple levels, so I will do my best to cover everything.
When you are creating a group in Structure mode, it points to an object that exists in that mode. However, when you switch to Staged construction, intersection creates new objects, thus making the old ones "obsolete" (not entirely, but mostly).
To link objects from Structures and Staged construction, we have implemented a function called get_equivalent() to assist with that. You can find nice examples in our Scripting reference and how to use it.
I hope that this part is clear. Moving to the questions:
1. In principle, you can either iterate over the contents of the group, as Plate_1 contains Plate_1_1, Plate_1_2, etc. or use the get_equivalent() function.
2. Positive and Negative interfaces are just interfaces for PLAXIS. You can use the following code, though to help you find the user feature (uf) you are looking for based on the ._plx_type property. I will add the code snippet below the screenshot of my example.
A similar discussion was done here: RE: [Python] Results for all Interfaces from a group of Surfaces (faster)
def getplxUF(p, uftype): plxobj = None for uf in p.UserFeatures.value[:]: if uf._plx_type == uftype: plxobj = uf break return plxobj neg_interface = getplxUF(g_i.Plate_1_1.Parent, 'staged.NegativeInterface') print(neg_interface.Name) neg_interface.ActiveInFlow[g_i.Phases[-1]] = False
Hey Stefanos! Thanks a lot! I'll try it now myself :)