-
How to run functions that are defined in an ACT extension or Mechanical Add-on from a script?
I have an ACT extension installed for Mechanical. I want to run an Mechanical script that will leverage some of the automation that is defined in the ACT extension. How can I do that?
-
Mechanical ACT Custom Load for Macro Encapsulation: define step
I'm creating a custom load object through Mechanical ACT that encapsulates some APDL macro. This writes the APDL code to the ds.dat. How can I define at which step of a multistep analysis this macro gets written?
-
Is it possible to consider temperature dependent strength data for safety factor calculation?
Is it possible to consider temperature dependent strength data for safety factor calculation within the stress tool?
-
Error: attribute 'FieldsFactory' of 'namespace#' object is read-only
Hi, I am referring to a previous post on this forum which explained how we can convert a field to scalar values. https://discuss.ansys.com/discussion/2150/how-do-you-transform-direction-stresses-to-a-different-coordinate-system-in-dpf I am trying to use the same syntax in my code, but I am getting an error that says Please…
-
How to get Workbench Mechanical RSM job to return user files/folders?
In my Mechanical model I have a /POST1 command snippet that generates some files in a folder. The files are created correctly out on the remote solver (I can see the files in the scratch area), but when Mechanical copies the files back to my local directory, the folder and files are left behind. Is there a way to have RSM…
-
Python Result example - mapping data
Is there an example of Python Result to map result data from one mesh to another mesh?
-
How to create a coordinate system based on direction vectors and a specific origin?
I have principal axis vectors and center of gravity of a body. Now I want to create a coordinate system based on these vectors and center. But, Mechanical doesn't let me input vector information.
-
How to export all reaction forces and moments in a file ?
Hi, Here is my problem : I would like to : (i) create in Mechanical all the reaction forces and moments ; (ii) export all these data in a file (.csv for example). For the first point, I have writen a Python script, and I get a folder containing subfoler with reaction forces and moments for my boundary conditions, joints,…
-
Migrating ACT extension: error message with CreateLoadObject()
I'm migrating an ACT extension to a newer version of Ansys and I'm getting an error message that CreateLoadObject() takes 2 arguments and only 1 was given: How do I resolve this?
-
How to extract directional acceleration results on a node in ANSYS Motion?
How to extract directional acceleration results on a node in ANSYS Motion?
-
How to export Fluent msh file from Mechanical via scripting?
How to export Fluent msh file from Mechanical via Scripting? One can export it via GUI in Mechanical --> File --> Export
-
How to use SearchConnectionsForDuplicatePairs() ?
Mechanical offers an option to find duplicate contacts: Can this be used in scripting?
-
How to access results of Motion - Function Expression using scripting?
Hi all, is it possible to access results of Function Expression using scripting in Mechanical?
-
Overview of postprocessing capabilities in Ansys
In civil engineering, APDL has been traditionally used for both building up the models and postprocessing. Nowadays, many engineers are building their models in Mechanical, but they still use APDL snippet commands for getting some output data into txt files that are used afterwards in in-house tools. Which are the…
-
Integrate results over a subsection of a surface
I have a surface on which I have calculated a direction heat flux solution. I would like to add a script that then takes a region of interest of that surface and integrates the directional heat flux in that region.
-
How to create an Ansys UI Toolkit GUI box to get input from the user?
How to create an Ansys UI Toolkit GUI box to get input from the user?
-
How can I read a legend settings from a file from a script?
I have saved many Legends settings in xml files. I can access them interactively using the "Manage Named Legends" RMC on the results legend -> Named Legends -> Manage -> Import Also once the legends settings are loaded. How do I pick one from the list in my mechanical script? Thanks a lot
-
How can I convert coordinates from global to local CS in Mechanical?
When I select an entity in Mechanical, I can choose a coordinate system to display coordinates in the selection information. Is there a way to do it by script?
-
Python Result and DPF - how to select component
Using DPF to retrieve the deformation on a model. The operator returns a fields container with 3 components (UX, UY, UZ). How can I select the component to be plotted, in case I want to plot only UX for example ?
-
How to activate viewports in mechanical using script?
Dear Team, I am using four viewports in mechanical. As i need to save the image in each view port. I am looking for the the API to activate the viewport before saving the image via script. Thanks in Advance
-
What is the most efficient way to export lots of animations from Mechanical
If I want to export hundreds of mode shapes to small animation files what is the best way to do that considering speed of creation and small file sizes?
-
Multi-threading with DPF post evaluations In Mechanical
Hi all, Has anybody experimented with using the iron python threading module to start an async thread that does DPF post calculations? Use case is this could be called immediately after the solve is done since the results file is available. Users can still interact with Mechanical since the call after the solve is simply…
-
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…
-
In Mechanical scripting, how do I export results as an .avz file?
I want to loop over all result objects in Mechanical, create a 3D AVZ file (.avz) for each, and save them in the user directory.
-
Testing and ensuring the quality of python code developed for the scripting interface
Hi! Python scripting in Ansys Mechanical is slowly becoming more common in my team. Initially, I would share small snippets and files with function definitions directly with those who were interested in trying it out. Now that more people are becoming comfortable with the python interface, more engineers are writing and…
-
DPF solution for force and moment reactions
Hi all. I am looking for a DPF solution in mechanical that is equal to a force and moment reaction probe. I would like to be able to scope to either geometry, a contact, or to a construction surface that cuts through geometry. I am more interested in auto export of the data than contours in Mechanical, so creation of a…
-
How can I use Python Result object in an unconverged analysis to plot a custom result?
This is currently a limitation. If any user tries to use Python Result with an unconverged analysis, an error message will pop up and the Python Result will have the red lightning not plotting any result.
-
How to select active object ?
Hi, I have a script for the creation of an APDL command on object : joint_33 = DataModel.GetObjectById(33) command_snippet_37 = joint_33.AddCommandSnippet() command_snippet_37.Input = r"""toto""" I would like my script to be more robust and change the first command line. Is there a way to select the object not by the ID…
-
Check for mesh connectivity between two bodies
How to check whether there is mesh connectivity between two bodies using scripting? for example, manually I can use mesh connection option in Display settings to verify: upon observation, I can confirm whether it has mesh connectivity or not. but, if I have to verify the same using scripting, is there any way?
-
How to get the total length of an edge (from mesh) in Mechanical via Scripting?
I would like to extract length of an edge. Not from Geometry but from Mesh, as geometric length and length based on summing up individual element edge lengths is different.