Extracting Material Names from Plaxis Output using Python

Hi, I have a question regarding the extraction of material information from Plaxis Output.

Following the example given by this article: https://communities.bentley.com/products/geotech-analysis/w/plaxis-soilvision-wiki/45443/material-lists-in-plaxis-python , I tried to extract a list of soil material names in the model by modifying the code like so: 

Soil_list = [mat.MaterialName.value for mat in g_i.Materials[:] if mat.TypeName.value == 'SoilMat']

This worked perfectly in Plaxis Input. However, when I tried to apply the same code with Plaxis Output scripting, the error "Requested attribute 'TypeName' is not present" occurred. I further tried other ways like:

Soil_list = [mat.Name for mat in g_o.Soils]

But this only returned a list of ['Soil_1', 'Soil_2', ...], which is not what I want.

So my question is: Is there any python code I can use to extract material names from Plaxis Output?

Thank you.

Parents
  • Dear Wei,

    It is not clear from your message which version you are using. I am currently using our latest PLAXIS 2D CONNECT Edition V20.04 and the list you create works just fine, as you can see below:


    Note that a material object is typically assigned to the property Material that belongs to the Soil object. Output though gets information from Input, so Soils starting from Structures (Soil_1, Soil_2, etc.) get intersected when after Mesh mode to multiple objects (Soil_1_1, Soil_2_1, Soil_2_2, etc.)

    Therefore you need to extend your loops in the list comprehension even further to achieve what you want:
    Soil_list = [soil.Material.MaterialName.value for soil_group in g_o.Soils for soil in soil_group]

    Note that for more questions, you can also submit a service request. Then, one of our support engineers can help you in detail:
    https://apps.bentley.com/srmanager/ProductSupport

Reply
  • Dear Wei,

    It is not clear from your message which version you are using. I am currently using our latest PLAXIS 2D CONNECT Edition V20.04 and the list you create works just fine, as you can see below:


    Note that a material object is typically assigned to the property Material that belongs to the Soil object. Output though gets information from Input, so Soils starting from Structures (Soil_1, Soil_2, etc.) get intersected when after Mesh mode to multiple objects (Soil_1_1, Soil_2_1, Soil_2_2, etc.)

    Therefore you need to extend your loops in the list comprehension even further to achieve what you want:
    Soil_list = [soil.Material.MaterialName.value for soil_group in g_o.Soils for soil in soil_group]

    Note that for more questions, you can also submit a service request. Then, one of our support engineers can help you in detail:
    https://apps.bentley.com/srmanager/ProductSupport

Children
No Data