TAGGED: commands, postprocessing, python-scripting, script, workbench
-
-
April 6, 2024 at 1:50 pmBobSubscriberHello!Â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 amAniketForum Moderator
so 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.
Ansys Innovation Space
Trending discussions
- How to apply Compression-only Support?
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Image to file in Mechanical is bugged and does not show text
- Element has excessive thickness change, distortion, is turning inside out
Top Contributors
-
1772
-
635
-
599
-
591
-
366
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.