How to make sketches using Abaqus Scripting (Part 3)

Sketches are widely used in Abaqus during the preprocess of the geometry of our FE models. For instance, we use sketches to create parts (extrusion, revolution, sweeping…), to make partitions and cuts, etc. Therefore, to take advantage of the automation of Abaqus through scripts, we need to know how to generate these sketches using Python commands.

This is the third post in this series on the creation of sketches in Abaqus by means of Python scripts. If you missed the previous ones, I recommend you to take a look at:

  • Part 1: Getting started with sketches using Python scripts.
  • Part 2: Splines, sketch geometry and vertices.

1. Debugging Python commands in sketches

Very often we run into the same situation: we want to test Python commands right from Abaqus/CAE to check whether it works or not (i.e. debugging).
However, when we open an existing or a new sketch and try to run these Python commands from the Command Line Interface, we may get some unexpected behaviour in most cases.

This happens because Abaqus employs temporary sketches before we complete them in CAE (“Done“):

  • __edit__: this sketch is created when we open an existing sketch.
  • __profile__: this one is generated when we create a new sketch.

In the next video, we will explain how these “__edit__” and “__profile__” sketches are created by Abaqus/CAE and how to use them to avoid all sort of errors and weird behaviour of sketches while testing and debugging Python commands.

Download the script to generate the sketch of the double spiral shown at the beginning of the video (watch the video of part 2 for all the details). And of course, if you have any question/suggestion/opinion leave it in the comments section below.

You can also get started in Abaqus/Scripting with Python in this post. This is the starting point to learn how to create your own scripts from scratch.

I hope that you find these tips useful!

Leave a Comment

Scroll to Top