-
-
April 25, 2023 at 3:56 pm
Matthew Little
SubscriberI wrote a Python script which creates a linearized stress intensity result for each path defined in the model. For each path, it creates the result, changes the coordinate system to the local system, then sets Zero Through-Thickness Bending Stress (ZTTBS) to True (Yes/On)
After running the script, the Details of any given linearized stress result created from the script shows everything is set up properly. But after solving the results and looking at the Worksheet for a result, it does not actually zero out the bending stresses. However, if I go back to the result object, set ZTTBS to 'No' and then back to 'Yes' manually, then solve, it sets the three bending components to zero as it should be doing.
My question is: when scripting this, is there a need to somehow 'update' the result so when solving the first time it does it correctly? I've tried to suppress and unsuppress the solution objects to try to 'update' them, but it does not fix the issue.
A sample of the script is shown below. Not the full thing but enough to see what it's doing.
a=Model.Analyses[0]
for path in paths:
  sols=a.Solution
  sint=sols.AddLinearizedStressIntensity()
  sint.Name=path.Name
  sint.Location=path
  sint.CoordinateSystem=csys #Local csys for given path
  sint.ZeroThroughThicknessBendingStress=True -
April 29, 2023 at 4:20 am
mjmiddle
Ansys EmployeeThis appears to be a defect. Even after setting sint.ZeroThroughThicknessBendingStress=True, if I query the value it will still read False, even though the Details entry has changed to Yes.
Instead, Change the property by this method:
prop = sint.PropertyByName("ZeroThroughThicknessBendingStress")
prop.InternalValue = 1 -
May 1, 2023 at 1:01 pm
Matthew Little
SubscriberThat appears to have fixed the problem. Thanks for getting back to me on this. Appreciate it
-
- The topic ‘Zero Through-Thickness Bending Stress via Scripting’ is closed to new replies.
-
5844
-
1906
-
1420
-
1305
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.