-
-
August 18, 2021 at 3:55 pm
nicolicfs
SubscriberI inserted some Python code in my Solution. I want the code to execute after the model is solved, so I set the Target Callback to "After Post". I then right-clicked to "Connect" the code. When I subsequently solve the model, the code executes flawlessly. However, if I close Mechanical and re-open it, the code is not connected, so I must "Connect" it again for the solver to proceed. The help file indicates that "Connect" only needs to be re-done if the Python code is changed (which it wasn't, in fact, nothing changed!). Below are images from before closing Mechanical and after re-opening it.
August 18, 2021 at 7:04 pmnicolicfs
SubscriberI found the solution to my problem. Seems this is by design, but there is a workaround:
Resuming Databases with Python Code Objects (ansys.com)
August 19, 2021 at 6:53 amErKo
Ansys Employee
Many thanks for posting the solution to your question.
All the best
Erik
Viewing 2 reply threads- The topic ‘Why won’t my Python code stay “connected” when I close/re-open Mechanical?’ is closed to new replies.
Innovation SpaceTrending discussionsTop Contributors-
6450
-
1906
-
1457
-
1308
-
1022
Top Rated Tags© 2026 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-
The Ansys Learning Forum is a public forum. You are prohibited from providing (i) information that is confidential to You, your employer, or any third party, (ii) Personal Data or individually identifiable health information, (iii) any information that is U.S. Government Classified, Controlled Unclassified Information, International Traffic in Arms Regulators (ITAR) or Export Administration Regulators (EAR) controlled or otherwise have been determined by the United States Government or by a foreign government to require protection against unauthorized disclosure for reasons of national security, or (iv) topics or information restricted by the People's Republic of China data protection and privacy laws.
