Let's Simulate – Handling contacts in practice
Season 1 – Efficiently generating thousands of contact definitions

Automating Contact Definition in Ansys Mechanical Using Python Scripting and the Hashtag Workflow
Do you struggle to systematically create contacts in large FE models with thousands of components while keeping track of everything? In this series, Florian Bonin and Dr. Markus Kellermeyer show how Python scripts within Ansys Mechanical can help with this challenging task – demonstrated on models ranging from a simple flange connection to a water tower with more than 4,500 components and tens of thousands of contacts. Based on hashtag markers in component names, contact groups are automatically generated, duplicates are detected, and settings are consistently transferred via XML and JSON – the method works just as well for bolted, riveted, and welded connections as well as shell models.
Watch as Markus tackles the thousands of contacts in a water tower model and how Florian dramatically simplifies and accelerates the process using Python scripts. See how they develop scripting code to automatically create a Named Selection, reliably transfer contact settings from one assembly to another, and how you can also gain access to these scripts.
Designated Site of usage and contact
Detailed agendas of this series
Duration of each episode: 30 minutes.
Season 1 – Efficiently generating thousands of contact definitions

- Where is the Python scripting GUI in Ansys Mechanical?
- Adding a finished custom button to the Mechanical GUI
- Result analysis: Which contacts were detected?
- Automatically build contact groups based on hashtag markers
- How would Markus create contacts without a script?
- Choose the right tolerance value for the search radius (rule of thumb: minimum edge length)

- Split a contact group into cylindrical and planar contacts via JSON
- Programming a new scripting button
- Create a Named Selection directly via the scripting API
- Live scripting & debugging
- Copilot and Ansys GPT for support

- Assigning hashtag markers in Ansys Discovery
- How are hashtags added in Mechanical?
- Creating contact groups using the scripting button
- Understand how the SCANTMP contact group works as the scan basis
- Importing contact settings for other contacts
- Increase the search radius iteratively to find all contact groups completely

- Manually structure the water tower model (4,500+ parts) without a script
- Use Named Selections, Box Select, and Select by Size for this
- How far does Markus get? Does he give up?
- Florian supports with a Python script
- Performance advantages of scripting for large models
- Verification methods: modal analysis and contact check via "Go to Bodies without Contact"k

- Import and control of contact settings via an XML file
- Bulk modification of contact definitions via script
- Import of contact group settings via a JSON file
- Avoid errors when renaming components and with hashtag capitalization
- Batch execution via Mechanical API / Python scripting
- Apply the method to riveted, welded, and shell-model connections as well
💡 Let's Simulate - What is it?
Engineering software in action in series format
An exclusive service for CADFEM Learning Subscription customers.
Based on the "Let's Play" approach - known from the video game world - you will experience simulation software in action in this format. You look over the shoulders of experts as they work on the simulation model. In-depth engineering. Practical tips from years of experience. Each series with its own thematic focus.
Your experts

Florian Bonin




