-
Is your scripting up to scratch?
We want to hear from you! What's the most useful Ansys scripting tip you've found? It could be on the forum, in documentation, or anywhere else. It just has to be... * About Ansys * A developer tool tip (to do with coding or PyAnsys) * Something small, like a specific command or tool you noticed We'd love if you could…
-
Simulation is pretty *cool* but how *cool* is it really?
Back in 2024 I presented a little introduction to simulation at PyCon. Introduction to Simulation And in that presentation I asked a fundamental physics question. If a heavy cat sits on a bridge of ice. Does that bridge break? But in that situation everything was simply two dimensional (to save time). But what if it…
-
Welcome! Please Read Before Posting
Welcome to the Ansys Developer community! If you are using the developer tool packages with Ansys simulation tools then this is your community space. This community has been created to ask questions of your peers, exchange ideas, and converse about developer issues within an Ansys context. Here are some guidelines: Keep…
-
New search functionality for the Ansys dev portal
Hello to our forum and portal users! We are very excited to be on the verge of rolling out our new unified search for the Ansys Developer Portal and Forums. This search will bring together the documentation and articles from the dev portal and posts and information on the forum into a new single search. Over time we will…
-
Random color material
Hello, Here is my problem : * When I create my materials in Workbench, I do not always change the color and/or sometimes, we many materials, colors are similar * So, In Mechnaical, when I display the geometry with color corresponding to material, it's not always simple My question : Is there a python function which is…
-
Question – APDL Coding for Multi-Step Moment Loading and Rotation Extraction
1.Assign a Remote Point and link the data of the corresponding edge to Measure_Point through a command.| * Apply a moment using a tabular input, divided into a total of 10 steps. * In Solution → Command (APDL), when applying the moment in 10 steps, write code to extract the rotation angle at each step. Problem: In this…
-
How would I extract the Centre of Mass from Named Selections
If I wanted to extract the Centre of Mass of bodies I selected within a named selection to a CSV file, how would I be able to do this with Ansys Mechanical scripting?
-
How to plot stress envelope S1max - S3max over multi-step analysis
Hi all, I'm working in Ansys Mechanical 2025 R2, using a Python Result object to extract and visualize the principal stress envelope (S1 − S3) over time. Hi all, I'm working in Ansys Mechanical 2025 R2, trying to use a Python Result object to extract and visualize the principal stress envelope (S1 − S3) over time. Here’s…
-
Can you use a CSV file as input to modify existing surface loads in mechanical?
Hello, I am new to the stress analysis roll at my company. I was given a model that applies 400+ forces, all of which are scoped by individual named selections. None of the named selections were defined by remote point (No remote points exist). Each Force is applied by surface effect with force components entered via…
-
How to retrieve data from rst file efficiently (memory, and time) using pyAnsys?
Hello, i am trying to retrieve displacements for select nodes in a very large rst file (>800 gb) in order to do a sumproduct on the results files (mode shapes) with modal displacements that i have computed in a third party software. I have tried the pyMAPDL method, which executes, but provides the incorrect displacements…
-
Is there a way to remove mesh edge from viscosity contour using PyDPF
Hi, I am trying to remove mesh edge from viscosity contour using PyDPF. **I used below sample code ** print(rinfo.available_results[5]) whole_mesh = dpf.operators.mesh.mesh_provider(streams_container=streams).eval() mu = dpf.operators.result.dynamic_viscosity(streams_container=streams, mesh=whole_mesh).eval() print(mu)…
-
Ansys Com SUpport
I’m trying to automate Ansys Mechanical from an external Python script using win32com.client.Dispatch("Mechanical.Application"). In my Student installation (2025 R1), I cannot find any such ProgID under HKEY_CLASSES_ROOT. Could someone confirm: Is COM automation officially enabled in Student Mechanical? If so, is there an…
-
PyAnsys Geometry, Import Catia file
How can a Catia file be imported and displayed? Also need to import the Named Selections.
-
pyDPF to do 2 simple tasks for LS prepost
Is there anyway I can carry out the following 2 tasks inside VS code without ever manually open LSPP 1) open LSPP (I can do this without using pyDPF or anything ansys related, with subprocess for example). 2) I need a way to run a command as if I am typing directly into the command window in LSPP such as (runpython…
-
PyAnsys - Running PyDPF Script for Large Model
Hi, I have a customer trying to run a PyDPF script on a harmonic analysis model with 4 million nodes and 150 frequency values yielding an rst file 260GB in size. The script is able to extract stresses and accelerations as expected, but when trying to extract element nodal forces, it throws an error:…
-
LS-DYNA Fails to Run via PyDyna Due to Missing lscasedriver.exe
I'm working on a simulation project using LS-DYNA and integrating it with a Python-based workflow using PyDyna. The same .k file runs successfully in GUI (Graphical User Interface) mode, but fails when executed via PyDyna. from ansys.dyna.core.run import run_dynarun_dyna("test.k", working_directory=r"../test3") >>> test.k…
-
Mesh transition from fine mesh to coarse mesh
Hello everyone, I would like to have a clean, if possible, sweepable mesh transition from a pipe cross-section with different wall thicknesses and a chamfer, which is generated as a solid model. As an example, the lower part is meshed with a 40 mm mesh and the upper part with a 60 mm mesh. Both the lower and upper parts…
-
How do I delete substeps in *.rst file
Hi, is there a soultion to delete all steps from the *.rst file from an unconverged solution except the last three steps? Because only the last 3-4 steps are interesting and it saves a lot of data. Because I do a buckling check and the solution is always not converged to find the last time step. Is there a solution in…
-
How do i get the result values of selected nodes?
I’m trying to add local min/max functionality in Mechanical as two separate buttons. When the user is viewing a result object—such as Equivalent Stress—and has selected some nodes, clicking one of these buttons should place a probe on the node with the minimum or maximum value. I’m currently stuck on the step where I need…
-
Python Script for Multi-Step Analysis: Activating/Deactivating Loads Per Step
Hello everyone, I am trying to automate a multi-step analysis in the Static Structural module using Python scripting from the Automation tab. My goal is to configure the loads and supports as follows: Gravity: This must be active in all analysis steps. Displacements: I have multiple displacement boundary conditions. For…
-
Obtain the same results with Spaceclaim and PyAnsys Geometry
I have written a Python Script inside Spaceclaim which generates me a Geometry and assigns some NamedSelections. When I try to run the same script using PyAnsys: modeler = launch_modeler_with_spaceclaim() modeler.run_discovery_script_file() the Results unfortunately differ It seems to mix up the bodies when I try to use…
-
How to do remote post processing using PyDPF
* DPF allows doing post processing remotely. Client-Server communication is based on GRPC protocol. * Multiple methods are available to launch dpf server in remote machine. Either using installed version of Ansys, PyDPF client or by standalone dpf package. Attached video demonstrates - 1. Starting a remote dpf server in a…
-
Select face by location (Rayfire)
How to select a face by location?
-
Export the Imported body temperature mapped thermals
I have imported the body temepratures in to the static structural model. This imported temperature results i want to export in this format BFE,Node,Temp,Value. Currently i am doing Export as csv file, then read back the csv and write into the format i want. Can we directly write the results in the format i requested?
-
How can I check if a named selection in Ansys Mechanical is a nodal named Selection?
Trying to automate some results extraction and I haven't quite figured out how to tell if the location/scope of the result, when it is a name selection, is nodes or a geometry/body.
-
Are simulation APIs and macros dead?
Hi everyone, I’ve tried Pyfluent and C++ macros in different simulation tools. Some were smooth, others frustrating. Do you think the way engineers interact with simulation tools will change, for example by relying more on APIs to hide software complexity?
-
Retrieve default element size
Hello all, Is there a way to retrieve the default element size using Mechanical scripting? I'm currently using Model.Mesh.ElementSize. This works as expected when an element size has been specified, however when the element size is set to default it returns 0. Thanks in advance!
-
Stress calculation from different locations
Hi team I am trying to create a 'python result' that takes a name selection (that is a line) and then takes some stresses offset from that line, does some math with the stress and plots on the graph the calculated result. Current struggle is to: Get the locations of name selection in x,y,z Get stresses at new x,y,z Plot on…
-
How to automatically select and edit contract regions that were auto generated from geometry
Hi, I have a model with 1,117 contract regions that were automatically created from the geometry. I've looked through some of them and believe they are all correct. I ran a test case and the model is connected well. However some of these contacts are screws in holes, and others are flat surfaces. I'm ok with the screw…
-
Interpolate displacements at generic (X, Y, Z) coordinates using DPF mapping operator
Hello, I'm working in Ansys Mechanical using the "Ans.DataProcessing" module to extract results of a FE analysis. In particular, I'm trying to interpolate displacements at a generic target point having coordinates (X, Y, Z) in a shell FE model, which does not correspond to the location of a FE node (see the red dot in the…
-
Rename Bodies by Location
In Mechanical is there a way to rename a group of bodies based on their vertical position? For example, rename a column of solid bolt geometries so that their Name varies sequentially based on their position in the column e.g. A1, A2, A3.
-
How to extract full modal damping table using pydpf?
I'm trying to extract modal damping data from a result file using PyDPF. I was able to get frequencies using metadata.time_freq_support. However, I also want to get the following data shown in the Ansys Modal Analysis table: Damped frequency Stability Modal damping ratio Logarithmic decrement Is there any way to extract…
-
How to export a figure of the Contact and Target Body View by script in mechanical?
The customer wants to export an image with contact body view and target body view.
-
Export a CSV with Element ID and nodal averaged stress of the element face in WB LS-Dyna.
Export a CSV with Element ID and nodal averaged stress of the element face in WB LS-Dyna.