-
How to automaticly open workbench and import a geometry file (e.g.spacecliam) to mechiancal
I want to use pyansys to automatic run workbench and import a geoemtry file (generated by spaceclaim) in a local folder ?
-
How to specify material and material model ( like Johnson cook model) using PyMechanical
The code and issue are stated here : https://github.com/ansys/pymechanical/issues/499
-
Export STL-file to specific location
Hey everyone, I am currently adding a 'Smoothing' object to my 'Topology Density' result in order to generate a STL-file after topology optimization. The following code is used: TOPO_OPT = ExtAPI.DataModel.Project.Model.AddTopologyOptimizationAnalysis()TOPO_OPT_SLN = TOPO_OPT.SolutionTOPO_DENS =…
-
How to run a function up on activating (Clicking on ) a python result file. for instance OnActivate
I have written a code that updates the tabular data of a python result. The tabular data are populated from the information in the properties section of the python result file so I need it to execute after the properties are loaded. At the moment I have a property that on_property_change, performs the task. Is there a way…
-
Transfer convection coefficient and ambient temperature data from csv to Mechanical via PyMechanical
I have data in csv and want to replace the convection coeff and ambient temperatures of convection boundary conditions in my mechanical model with the values in csv. How can I do this in PyMechanical?
-
Minimum requirements to include enums in embedded instance
Hey everyone, I am currently using an embedded instance of Mechanical in Python. I use the following code to include access to global variables: from ansys.mechanical.core import App, global_variablesapp = mech.App(version=231)globals().update(global_variables(app)) Then I discovered, that enums are still not available…
-
Python Result - Pressure Plot
Is there a way to use a python result object to create a contour plot of all applied pressures in Ansys Mechanical? It seems like the result file does not contain pressure information. How can I access the applied pressure to generate a plot showing the pressure in each time step?
-
How to process topology optimizations on different geometries automatically?
Hey everyone, my goal is to perform a topology optimization (TO) on 50+ geometries in ANSYS. For a single simulation my current plan is pretty straightforward: I open a new Workbench file, create a static-structural module, connect a topology optimization module to it and basically do all the neccessary steps in ANSYS…
-
How can I perform a parametric analysis through PyMechanical?
Here is an example code to perform a parametric analysis through PyMechanical with parameters that are not parametrized by Mechanical itself.
-
Adding Path to Equivalent Stress - Mechanical scripting
Hey everyone, I want to output some stress on paths and unfortunately I can't get it to add the paths to the stress. As you can see in the pictures my code looks like that: Spannung_Pfad = Model.Analyses[0].Solution.AddEquivalentStress() Spannung_Pfad.ScopingMethod = GeometryDefineByType.Path Spannung_Pfad.Surface =…
-
Change Inflation Mesh via PyMechanical
Hey everyone, I am trying to control the inflation layer on a mesh via a python script and got two problems. I try to address everything via NameSelection, since I have already defined them in advance and my current code looks like this: Rotor_Inflation = mesh.AddInflation() Rotor_Inflation.ScopingMethod =…
-
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.
-
Import Materials in PyMechanical
-
PyMechanical example for " how to access parameter of ANSYS mechanical"
I want to use pymechanical for the remote session and access the parameter of that ANSYS Workbench Mechanical file and again solve it on remote.
-
PyMechanical example for " how to access parameter of ANSYS mechanical"
I want to use pymechanical for the remote session and access the parameter of that ANSYS Workbench Mechanical file and again solve it on remote.
-
How do I create LS-Dyna analysis system using PyMechanical?
How do I create LS-Dyna analysis system using PyMechanical?
-
Python Code object to change objects Before Solve in R2021.2
I want to run a script that updates pressure objects before Solve (as a workaround to some bug in R2021.2 related to not correctly updating the Y-Axis data when opening the WB). But it seems the Python Code object can only read properties in R2021.2, when it is called as 'Before Solve'. When trying to modify a pressure…
-
Draw an ARC and a Circle
ExtAPI.Graphics.Scene.Clear() draw_cmd = ExtAPI.Graphics R=1 theta_in = 0 theta_end = (pi) np = 60 dtheta = (theta_end- theta_in)/np graphics = ExtAPI.Graphics for i in range(np): p1= draw_cmd.CreateWorldPoint (R*cos(i*dtheta+theta_in), R*sin(i*dtheta+theta_in),0) p2= draw_cmd.CreateWorldPoint…
-
Question regarding changing user defined charts' time steps using a python result script.
Hi I have a python result file that I am trying to get some custom result files evaluated in different time steps. for some reason I cannot find a method under a user plot object that would be similar to "Retrieve this result" as opposed to "Evaluate all results. In any case the application does not perform a "Evaluate all…
-
How can I run a Mechanical script in batch mode?
I have a Mechanical script that I can run by opening Mechanical and clicking Scripting>>Open script>>Run. How can I run this script in a batch mode?
-
Mechanical ACT Documentation
Hello, is there any consolidated documentation of commands, functions and properties for scripting in mechanical using python? I often got stuck looking for the desired function/property. ACT Reference quide is quite poor documentation. Also best practises as listing availible stuff in console are welcome. Thank you