-
Discovery Pull Helix revolve creates wrong height
Hi all, I have taken scripting of the Pull with helix revolve tool and want to parameterise. For some reason, the "height" of Pull is not being respected, e.g. creating a height of 34mm instead of the requested 31.9mm. This seems random, as for other dimensions the too works properly. Dscript file also attached. Can you…
-
Read data from txt with apdl commands inserted in tree
Hello everyone! I'm working in workbench mechanical (2022r2) in a coupled field module. I want to insert apdl commands in the tree to read a table and interpolate to get some results. I have a file (txt with values separated by comma)with element ids and for each element i have temperature and two parameters defined.…
-
Writing tabular data of force result item to list (CPython)
I have a script that writes tabular data to a list that works in IronPython. I am trying to convert the script to CPython in order to do some post processing with numpy and pandas. I am getting an AttributeError message. Is there a way to do this in CPython? data = []del data[:]force =…
-
How to export results (SMISC - axial forces and moments) for all the beam connections in Mechanical?
I have lots of beam connections in the model. I want to export the data in the below format into a csv. beam element type id, Beam name in Mechanical, Fx, My_i, My_j, Mz_i , Mz_j
-
Tabular load implemented from Python scripting
Hello everyone I am working in Ansys Workbench 2022R2 in a coupled field module. I am adding loads from scripting. With a single value works easily, but I want to use tabular data for the load. Can i read tabular data for a load from scripting? Can i set the step end time in analysis settings with input from csv?
-
Can we get the PID or Process name for an launch: ExtAPI.DataModel.Project.Model.Solve()
I have some basic script to follow the CPU and RAM useage during a solve but it would be more focused if I could get the actual usage for the given analysis. To do that I need to know what PID or Process gets started when a solve is started. Any ideas
-
pymapdl jupyter notebook example
I used the old training example and brought it into jupyternotebook/pymapdl: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v231/en/ans_tut/structural_cb.html The jupyternotebook file is in the attached zip.
-
How to get the material properties for defined element using Mechanical API or DPF?
Hello team, I'm creating a script that gets the stress values in elements defined by element Id and would like to compare the stress values with the ultimate ones for material automatically. So, I wonder how to get the values of material properties for the element with a defined Id using Mechanical API or DPF? Thanks
-
How to retrieve the material name of an element in mesh ?
I want to get the material name for each element so ican get it's properties in engineering data. i am using dpf but it only gave me the matid and i don't know how to link it to the name of the material. Thank you in advance. @AKD-Scripting-Team
-
Rename reaction forces base on definition
Hello everyone, I encounter a problem while creating a script to extract the Force reactions Fx, Fy and Fz at all boundary conditions. The thing I want to do is to extract them and then rename them base on their definitions to be able to quickly see which reaction forces correspond to which boundary conditions. Therefore,…
-
How can I call a ironpython script inside an another script
I am working on a 2D model of a transformer in Ansys Maxwell. I have created multiple IronPython scripts for assigning excitations, defining materials, creating a mesh, creating a simulation setup, etc. I want to call these scripts inside a script which will be my main script. how can I do that? if someone can provide an…
-
How can I using scripting get displacements as function of time at certain areas ?
We have a named selection in a mechanical transient (structural) system and we want to write all of the displacement for every time step to a text file for further post processing. How can we do that using mechanical scripting?
-
How can add certain results and group them
How can I with mechanical scripting add say stress and displacement results into a folder group?
-
Error extracting nodal forces from beam connection
I am working on building a script to pull forces from beam connections in a model. In my test model I have 2 shells with holes cut in each and a beam connection between them. In the UI I can place a 'Beam Probe' and get all the data I need, but I cannot seem to get it through DPF. I get the same error with Output Controls…
-
Create coordinate system with vector components
If I know the vector components of the principal coordinate axes, how should I go about creating a coordinate system using Mechanical scripting?
-
how to get elements based on element name IDs using ansys mechanical scripting?
for example, if I want to get all the elements of CONTAC174 of ename, how do I get it?
-
Getting the body ID from a node ID in Mechanical scripting
Just wanted to share a quick snippet that allows one to get the body ID (and potentially select the body and get information about the body) from a node ID using Mechanical scripting: Happy scripting!
-
How to create a result in DPF with deformed mesh whose scaling is different for each axis ?
Hello, As the title suggests, I want to create a result in DPF with deformed mesh whose scaling is different for each axis. When you normally create a result in ansys mechanical, you can adjust the scaling : But I want the scaling to be different for each axis, for example 1 in X, 3 in Y and 10 in Z. Does anyone know how…
-
is there a way to get solver data for point masses?
solver_data = solution.SolverData data=solver_data.GetObjectData(body) i noticed that if I try to put a point mass where "body" is written, that options is not supported. anyone know how else I can get this info for point masses?
-
Ansys mechanical scripting. How to get Element type ID's using mechanical scripting?
This figure is taken from the worksheet tab. I'm trying to use mechanical scripting to get the element type ids for element names I'm interested in. For example, if im interested in SOLID 187, I'd like to get the element type ID's for all solid187 using mechanical scripting.
-
DPF Operator C++
Hey everyone, I have a question about creating a custom operator in C++. Can this created operator be called in a DPF script in IronPython? Could someone please provide me with an example of creating such an operator and how to call it? Thank you in advance!
-
Can I change material properties in SpaceClaim through Scripting?
How can I access and change the properties of a Material assigned to a body in the Tree?
-
PathAnalysis package for ANSYS Mechanical
Extension package in python for ANSYS Mechanical for computing and exporting stress and temperature analyses along linear paths to produce analyses necessary for licensing pressure vessels under some regulations: https://github.com/tplobo/path-analysis.git
-
How can I rename xy, yz, zx planes so that the name reflects their current location?
When creating groups of planes of a constant x, y, z location the name is zeroed on the first specified value and the remaining planes names are defined by the offset from the zero value. For example, 3 planes equally spaced by 0.1m starting from 1m or 3m would be named x-plane=0, x-plane=0.1, x-plane=0.2. How can planes…
-
How can I rename isosurfaces and planes to round off names at selected number of significant digits?
Sometimes when creating groups of iso-surfaces or planes of a constant x, y, z location sometimes the name of the object can contain unexpected digits in it. For example, 3 x-constant isosurfaces with spacing 0.1 starting at 1m could produce names such as constant-x=1, constant-x=1.10000001, constant-x=1.2. How can this be…
-
How can I access Custom Component Properties in SpaceClaim?
How can I access a user-defined property in Custom Component Properties?
-
UDM scripts into PyAEDT
Hello, I have some old (by someone else) Python scripts & libraries for the purpose of creating geometries in HFSS, that I wish to bring into PyAEDT and use PyAEDT instead of UDM to create the geometries. What would be the steps to achieve this! I will greatly appreciate if anyone can provide some suggestions. Regards Abhi