5 ways to select geometry in Abaqus using Python

Written by Miguel

28 Mar, 2022

One of the most common operations and sometimes the hardest to automate in our Python scripts is the selection of geometry. This task is essential to assign material properties, define boundary conditions, control the mesh settings, create interactions, etc. The default method recorded by Abaqus is based on masks, but it has several drawbacks (not reliable when geometry changes and non-intuitive).

In this post, I would like to show you a few other methods to automate the selection of geometry using Python in Abaqus.

Methods to select geometry

The five strategies to select geometry in Abaqus (vertices, edges, faces and cells) using Python commands are:


#1 Masks

This is the default syntax used by Abaqus to record the selection of geometry through Python commands (getSequenceFromMask). It might be enough for geometries that do not change, but it is useless if the geometry changes.

#2 findAt

This is one of the most powerful and versatile methods (findAt). This Python function is used to retrieve geometrical objects (e.g. cells, edges…) by means of coordinates in 3D space.

#3 Functions 'getByBounding...'

This group of commands has 3 flavours: getByBoundigBox, getByBoundingCylinder and getByBoundingSphere. They return the geometrical objects contained into the box-cylinder or sphere defined by the arguments.

#4 Boolean operations

Boolean operations (union, difference and intersection) are supported among sets, both at the part and the assembly levels. In essence, the Python function does not return geometry, but it creates a new set (setByBoolean).

#5 Direct selection of geometry

We can filter geometry features individually based on one or multiple conditions. You can read this other blog post on how to get information from the geometry using Python.

Some of these methods are also applicable to mesh selections, such as masks and getByBounding functions. 


Practical cases

In the following video you will see a practical demonstration on how to apply these 5 strategies in Abaqus using Python scripts.

If you are interested in Abaqus/Scripting with Python, take a look at the first and second scripts to generate the FE models shown in the video. And of course, if you have any question leave it in the comments section below.

And if you want to get started in Abaqus/Scripting with Python check out this post to learn how to create your own scripts.

I hope that you find these tips useful!

Download the FREE GUIDE




You might be interested as well…


Submit a Comment

Personal details provided through this form will be managed by TecnoDigital School responsible for this website. The aim of collecting and treating the details required is the management of the comments made in this blog.

Legitimation: Consent of the interested. Requests cannot be atended if personal details are not introduced in the fields marked as mandatory.

You will be able to exercise your access, rectification, limitation rights and to suppress your personal details through media@tecnodigitalschool.com, as well as the right to make a compliant through a control authority.

You can read additional information about Personal Details Protection in the website: https://tecnodigitalschool.com, as well as the privacy policy.