Model construction with Python API
Re: Model construction with Python API
Thank you so much!
So now how can i create a quad mesh with pythonAPI?
So now how can i create a quad mesh with pythonAPI?
Re: Model construction with Python API
Hi team,
i would like to implement, within my python code, the materials pimy and pdmy to model my soil layers. The parameters are the standard ones for medium clay and medium sand that are on openseeswiki. I attach the file below
thanks for your help!!
i would like to implement, within my python code, the materials pimy and pdmy to model my soil layers. The parameters are the standard ones for medium clay and medium sand that are on openseeswiki. I attach the file below
thanks for your help!!
- Attachments
-
- MakeGeometry - prova PIMY.rar
- (3.19 KiB) Downloaded 175 times
Re: Model construction with Python API
Just change these 2 lines (use_rho is not an attribute of PIMY, and PIMY is just in ND folder, without the sub-group name)
Re: Model construction with Python API
Add this to the end of your file. By the way, you cannot do a full quad mesh, because of the cuts you have in the deposit shape
mc = doc.meshControls
mesh_size = 10.0
for _, gc in mc.geometryControls.items():
for fc in gc.faceControls:
fc.topology = MpcMeshAlgoTopology.TriaTetra
fc.algorithm = MpcMeshAlgo.Unstructured
for ec in gc.edgeControls:
mesh_seed = MpcMeshEdgeSeed()
mesh_seed.type = MpcMeshEdgeSeedType.UniformBySize
mesh_seed.size = mesh_size
ec.seed = mesh_seed
App.runCommand("BuildMesh")
Re: Model construction with Python API
The material PIMY run well for bedrock but not for soil layers. Why?
The error is as follows.
For what concerne the mesh, I have problem with the package MpcMeshAlgoTopology and MpcMeshAlgo too.
Can you help me?
Thank you!!
Fabiola
The error is as follows.
For what concerne the mesh, I have problem with the package MpcMeshAlgoTopology and MpcMeshAlgo too.
Can you help me?
Thank you!!
Fabiola
- Attachments
-
- MakeGeometry - prova PIMY 3.rar
- (3.31 KiB) Downloaded 173 times
-
- error pimy.PNG (17.72 KiB) Viewed 3258 times
-
ValentinaSB
- Posts: 61
- Joined: Thu Dec 09, 2021 10:53 am
Re: Model construction with Python API
Hi Fabiola,
Regarding the error. Check the indent on lines 178-181. With the correct indent, it works for me. Also, check one more time the indent for your mesh part with for loops. Let me know.
Regarding the error. Check the indent on lines 178-181. With the correct indent, it works for me. Also, check one more time the indent for your mesh part with for loops. Let me know.
Re: Model construction with Python API
As Valentina said, you have indentation issues.
First in line 178 (as the error message says). Here you mixed tabs and whitespaces as indent (this is not allowed in Python). You have to be consistent in your file, either with whitespaces or tabs for indentations, don't mix them.
Secondly, you completely disregarded indentation in the nested for-loops for the meshing part.
First in line 178 (as the error message says). Here you mixed tabs and whitespaces as indent (this is not allowed in Python). You have to be consistent in your file, either with whitespaces or tabs for indentations, don't mix them.
Secondly, you completely disregarded indentation in the nested for-loops for the meshing part.
- Attachments
-
- MakeGeometry - prova PIMY 3.zip
- (3.35 KiB) Downloaded 185 times
Re: Model construction with Python API
Thank you!
Now the focus of my work is to assign the AbsorbingBoundaries on boundary sides (as in the figure) by API python.
Can you tell me how I can write the tag correctly?
Sorry for all the requests.
I await your reply, thank you again.
Now the focus of my work is to assign the AbsorbingBoundaries on boundary sides (as in the figure) by API python.
Can you tell me how I can write the tag correctly?
Sorry for all the requests.
I await your reply, thank you again.
- Attachments
-
- Absorbing.PNG (29.51 KiB) Viewed 3171 times
Re: Model construction with Python API
I added a code to select all boundary edges for absorbing boundaries.
Now you can proceed as we did for physical and element properties of the main geometry
Now you can proceed as we did for physical and element properties of the main geometry
- Attachments
-
- MakeGeometry - prova PIMY 3.zip
- (3.72 KiB) Downloaded 184 times
Re: Model construction with Python API
Hello team!
I'm here again to ask for your help. This time i'm modeling directly on STKO and i don't be able to run the analysis. I don't know where i s the problem, maybe it's about the mesh? I don't know how i to do. I attach the file.
Thank you for your help.
Fabiola
I'm here again to ask for your help. This time i'm modeling directly on STKO and i don't be able to run the analysis. I don't know where i s the problem, maybe it's about the mesh? I don't know how i to do. I attach the file.
Thank you for your help.
Fabiola
- Attachments
-
- Schema 1.rar
- (364.98 KiB) Downloaded 220 times