Sometimes you have polycurves in a PLAXIS 2D model (e.g. after importing a DXF file) that are just the outlines of the desired shape. But typically, the intention is to have polygons instead of these polycurves, so you can assign soil materials to these areas.
This provided script will check for polycurves that can be made into polygons based on the following:
- The polycurve consists of only lines, not arcs or other types
- The polycurve is closed (i.e. same start and end coordinate)
- The to-be-made-polygon does not yet exist
The script offers the user the possibility to generate these polygons and optionally delete the original polycurves.
Usage instructions for Python script
To use this Python script:
- Download the file (use Save As...);
- copy the polycurve_to_polygon_2D.py file to this folder:
<PLAXIS 2D installation folder>\pytools\input
By default the installation folder for PLAXIS 2D is:
C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\
For older versions, this is:
C:\Program Files\Plaxis\Plaxis 2D\
- Open a Plaxis file with some polycurves or import a .dxf file with polycurves
- Make sure you are in Structures mode
- In the Expert menu, go to Python > Run Python tool. Here you should see the name of Python file.
- When selecting it, it will execute the script to change all qualifying polycurves into polygons.
When you do not have access rights to add the script in this folder, alternatively, you can choose to use Expert menu > Run Python script > Open... to manually open and run the file.
The script is tested with PLAXIS 2D 2018.00 and PLAXIS 2D 2019.00 with Python 3.4 using a simple DXF geometry file.