TAGGED: apdl
-
-
July 24, 2024 at 5:24 pmNick JankowskiSubscriber
Hello all,
I'm rather new to using APDL, and would like to write a command that takes each component in the geometry tree, finds the max stress of only that component, and stores it in a table that is exported. What I'm having difficulty in understanding is how APDL finds and initializes each component, or an easy way to loop over every component in an assembly. The error I keep getting is 'Component is not defined' and I believe it's because APDL doesn't know where to pull the name from? Any help is appreciated
-
July 25, 2024 at 6:34 amErik KostsonAnsys Employee
Â
Â
Hi
It is outside what we (ansys empl.) can help here with (provide apdl code for this).
Â
Perhaps other forum members can help.
Â
There is a post that does this using Mechanical scripting though.
https://discuss.ansys.com/discussion/3542/write-max-vm-stress-for-each-part-in-named-selection-to-file
Â
Below is also a course and info on mehanical scripting:
https://www.youtube.com/watch?v=Q0MpwVSiFGs
Â
Hope it all helps.
Â
Erik
Â
Â
-
July 26, 2024 at 7:25 pmNick JankowskiSubscriber
Hello,
That post is really helpful! But I don't think the script runs properly. I have been attempting to rename each body 'under the hood' of Ansys and use the new name (body_1,body_2...) to post-process results easily in APDL. However, now Ansys is returning the error:Â
15:09:41
I've looked through the documentation of GetGeoBody().Id and I feel as though I'm deploying it correctly? Here is the snippet of code:
 Empty parentheses.                                                    Â
 *** ERROR ***                          CP =      0.062  TIME= 15:09:41
 The above error occurred processing field= BODY.GETGEOBODY().ID       ÂÂfor body in bodies:    Â
  if body.Suppressed is False:
    nb_bodies += 1
    with Transaction():
      new_snippet = body.AddCommandSnippet()
      string1 = 'body_'+str(nb_bodies) + ' = body.GetGeoBody().Ids \n' -
July 26, 2024 at 8:09 pmNick JankowskiSubscriber
Got it working! Had to do some rearranging
-
- The topic ‘Post-Processing Stress Using APDL’ is closed to new replies.
- 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
-
1411
-
599
-
591
-
555
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.