-
Select target elements using Point in Polygon Ray Casting Algorithm.
Components 1, 2 and 3 are connected to the base plate as bonded contacts. How can I select the element faces on the base plate which are attached to the component base? Geometry Output
-
Is there an API call to Quit mechanical
What is the api script to close mechanical from Mechanical?
-
How to work with .csv data in Mechanical: Export, Import and plot
There is often a need to work with data in a .csv format (comma delimited text file). You can store results, import conditions etc… This attached analysis uses python code and results objects to: Automatically export displacements to a .csv file on solve Import from a .csv file to create a displacement condition for each…
-
Configuring MS Visual Studio to Develop IronPython for ANSYS Scripting
Hi ANSYS Developer Community: I would like to be able to develop IronPython code in Microsoft Visual Studio for scripting applications in ANSYS Spaceclaim, ANSYS Discovery, ANSYS Electronics Desktop, etc. Right now, it is unclear to me how to properly configure Microsoft Visual Studio to work with IronPython as oppsed to…
-
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…
-
ANSYS Mechanical Embedded API - Vector Principal Stress Coordinate System Creation
Folks, I have a vector principal stress direction scoped to a single node within a solution combination result. Is it possible to automate the creation of the aligned coordinate system? Thanks, Stu P.S. What is the best way to hone my ANSYS API programming skills? I know it predominately IronPython. If I studied…
-
Importing library os in Mechanical
I want to import the library os in Mechanical, but i always get this error message. I have this on two different computers with different Ansys versions (2022R1, 2023R1). I am sure that it worked in the past and in this forum the library is often used aswell.
-
How to change text style and size in Ansys Mechanical ?
Hello everyone, do you think we can change the Tree objects text style or size in Ansys Mechanical using scripting? I can manipulate the graphic labels using javascript, so i think it should exist something similar to do the same with text in Ansys Mechanical using javascirpt or Python. I'am talking about this text , i can…
-
[DPF] An unexpected error occurred - rst file used by another program
Hello, I'm writing some codes in DPF in a python result inside my modal analysis, so I need to read the rst file with the dataSource accessed with the "dpf.DataSources(analysis.ResultFileName)" command. My code works well, but when I want to resolve my modal analysis, it shows this error : An unexpected error occurred :…
-
Edit legends with a UI box in Mechanical
It has come to my attention that several users have issues editing the legend in the Mechanical UI due to a graphical defect with certain NVIDIA GPUs. How can I create a python button in Mechanical that allows me to edit the upper/lower bounds?
-
How to plot within a Python result the total stiffness energy in a named selection with ansys dpf ?
Hello everyone, As the title suggest, I want to plot within a Python result the total stiffness energy in a named selection with ansys dpf. I made something that plot the stiffness energy by element on a given named selection, and I think I have to use fields operators to plot the total stiffness energy on the named…
-
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…
-
Microsoft Authentication Library support for Ansys Plugin
Need help regarding Microsoft Authentication Library support for Ansys Plugin.
-
How do I export pictures for multiple design points?
I am running a simulation for which I create figures for various results. I want to export them for each design point. How can I do this?
-
Robust Example of Python Result Property Provider and Script
Hi all, This is just an example of some advanced implementations for python result objects. There are some more properties, helper methods and general how-to information in the code.
-
How to call csharp from Ansys plugin(IRON PYHTON) .
Is it possible to call c# from IRON Python plugin. If yes kindly share the details.
-
Export data from a chart object to text or csv using Python
Hello, I am able to access the chart object using Python, but I am not sure what function will export it to a text or csv file. I checked the list of attributes, and none of them offer the "Export" of chart data. I am guessing since the chart object has a table, there should be some way to access it. Can someone point me…
-
Using Mechanical Scripting, how can I export images of results?
-
How can I read a file using Python?
How can I read a file using Python?
-
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
-
Best practices for visual studio ACT Extension Python Coding
Does anyone know of any documentation on how to set up visual studio / have any recommendations for a typical workflow on how you code? I've been coding without an IDE, but this requires repeated opening and closing of mechanical to refresh my code whenever I'd like to test it. I'm also coding without type suggestions from…
-
Increasing Speed of DPF in Extensions
I am looking into using DPF to drive the results in extensions instead of using the legacy results reader. While DPF is much faster than the legacy reader for getting things like nodal von mises stress, I am finding that the extensions performance is still substantially worse than the hard coded von-mises available in…
-
Export local variables from existing AEDT project
In an existing Ansys Electronic Desktop project, I have defined a list of variables (Design Properties > Local Variales). I want to export the variables and the values, so I can reuse them in a Python script with AEDTLib. How can I do that?
-
Mechanical Scripting -export figures etc. as Word file
Hello, I want to send the figures directly into the word file. Is there any simple code ready for this? https://www.linkedin.com/pulse/script-tip-friday-connecting-mechanical-excel-structural-analysis import clr clr.AddReference("Microsoft.Office.Interop.Word") import Microsoft.Office.Interop.Word as WordNS I read the link…
-
How do I find the time varying center of gravity location of my deforming body using DPF?
The COG of a body might vary with time as the body deforms and you might be interested in knowing how to compute the time varying COG. This example also highlights on how you can create your own mesh with DPF.
-
What is the alternative to NumPy in iron python?
Because Numpy and SciPyY are numerical libraries supported by Python rather than IronPython, they cannot be used with ACT.