TAGGED: #python-#ironpython, macros-scripting
-
-
October 16, 2024 at 1:42 pmantoine.crestani.extSubscriber
Hello everyone,
I work with Mechanical and workbench Scripting a lot .
Specifically, I run calculations in Mechanical using gitlab runner to planify the execution of my tests.My scripts all follow the same structure , that i will simplify here.
A first Bash Script calls a Main Journal using the following flags :
#################
"%AWP_ROOT242%\Framework\bin\Win64\RunWB2.exe" -B -R "%CI_PROJECT_DIR%\MainJournal.wbjn"
#################MainJournal.wbjn :
#################
# Setup Environment variables
...
# setup files
...
# Run script
RunScript(FilePath=Another_journal.wbjn)
#################Â
Another_journal.wbjn does operations that are specific to every calculation i run.Another_journal.wbjn :Â
#################
# More setup
...
# load model
Unarchive(ArchivePath="Model.wbpz", ProjectPath="Model_name.wbpj")
system1 = GetSystem(Name="SYS")
container1 = system1.GetContainer(ComponentName="Setup")
container1.Edit()
Simulation.RunScript(FilePath="Macro_file.py", IsMeshing=False, ModelName="Model")
#################In 23 R2, this worked flawlessly.Â
However, when we updated from Ansys 23R2 to Ansys 24R2, all my scripts stopped working.Â
I have narrowed the failure to the container1.Edit() line. my scripts would just stop there, and do nothing.
Through trial and error, i realized that i could simply remove that .edit() line and most of my scripts would still work.
Not all though. For example , i cannot use legend.Reset() specifically, as well as some other things like OnClick callbacks linked to Mechanical Interface buttons do not work .
I understand that this is a very limited use case, but could anyone point me to what changed between versions 23 and 24 with the container.edit() function ?
Additionnally, what could i do to re-add the .Edit() line ?
Any help would be greatly appreciated
PS: Â If someone could tell me how to format a block of text as code i would appreciate it too ! -
October 21, 2024 at 11:26 amAniketForum Moderator
Hi antoine,
ANSYS ACT Migration Notes does not indicate this API change, have you tried recording the same function in both versions? Is it any different?Â
-Aniket
-
- You must be logged in to reply to this topic.
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- How to apply Compression-only Support?
- Geometric stiffness matrix for solid elements
- Frictional No separation contact
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
-
1426
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.