TAGGED: commands, postprocessing, python-scripting, script, workbench
-
-
April 6, 2024 at 1:50 pm
Bob
SubscriberHello!ÂI am running the wbjn script from workbench. The rest runs well, but it appears that ‘post_script.py’ is not being imported to the model, as ‘post_script.py’ is not executed. So, I think it’s probably a problem with ‘Model_exp.SendCommand’. Can I ask for advice on the cause?ÂÂ# encoding: utf-8# 2021 R2SetScriptVersion(Version="21.2.209")Âsys_exp = GetSystem(Name="SYS")sys_imp = GetSystem(Name="SYS 1")ÂCleanSystem(Systems=[sys_exp])CleanSystem(Systems=[sys_imp])ÂdesignPoint1 = Parameters.GetDesignPoint(Name="0")designPoint1.SetParameterExpression(Parameter=Parameters.GetParameter(Name="P10"),Expression="10 [degree]")designPoint1.SetParameterExpression(Parameter=Parameters.GetParameter(Name="P11"),Expression="10 [mm]")ÂModel_exp = sys_exp.GetContainer(ComponentName="Model")Model_exp.Edit(Hidden=False)ÂUpdate() # SolvingÂscript = open("post_script.py", "r")cmd = script.read()script.close()ÂModel_exp.SendCommand(Language="Python", Command=cmd) -
April 8, 2024 at 10:58 am
Aniket
Forum Moderatorso if you copy-paste the content of the post_script.py to the cmd variable does it work as expected?
-Aniket
-
Viewing 1 reply thread
- The topic ‘Workbench script (SendCommand: send python script) does not work’ is closed to new replies.
Innovation Space
Trending discussions
- LPBF Simulation of dissimilar materials in ANSYS mechanical (Thermal Transient)
- Real Life Example of a non-symmetric eigenvalue problem
- How can the results of Pressures and Motions for all elements be obtained?
- BackGround Color
- Contact stiffness too big
- Element Birth and Death
- Python-Script to Export all Children of a Solution Tree
- Which equations and in what form are valid for defining excitations?
Top Contributors
-
4597
-
1495
-
1386
-
1209
-
1021
Top Rated Tags
© 2025 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.