TAGGED: act, automatisation, mechanical, python, scripting
May 20, 2022 at 9:25 amfabian.maierSubscriberHello i wrote a Python script which basically imports a views.xml file and loads different model views from this file. This script already works fine but i would like to run it automatically each time a Mechanical Session is launched.
I don't want to use the "Connect/Run Python Code Objects When Mechanical is Launched", because the solution is being deleted when adding a Python Script to the Model Tree.
ACT would be an option, but i did not find a proper function to automatically call the function.
Is there any way to automatically run a python script when a mechanical is started?
Thanks in advance!
May 24, 2022 at 10:55 amAniketAnsys EmployeeWould you be able to create an extension and make it default, and then run this code using onload callback of this extension?
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
May 31, 2022 at 2:23 pmfabian.maierSubscriberHello Aniket, thank you for your reply.
I tried to implement this in my extension, unfortunately, this doesn't work for some reason. I tried the extension with OnInit, OnReady and OnLoad, but nothing worked for me.
My xml file looks like this:
And the function AutoImportViews looks like this: ´╗┐
result_loc = Model.Analyses.AnalysisSettings.SolverFilesDirectory
Is this setup correct for my application?
If i use the callback
what function input do i use in def AutoImportViews(input):? According to the ACT Guide it should be:
Called when a project is loaded.
but i don't know how to set the correct input for OnLoad.
- You must be logged in to reply to this topic.
Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- whether have the difference between using contact and target bodies
- User manual
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- Colors and Mesh Display
- material damping and modal analysis
© 2023 Copyright ANSYS, Inc. All rights reserved.