TAGGED: apdl
-
-
July 24, 2024 at 5:24 pm
Nick Jankowski
SubscriberHello 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 am
Erik Kostson
Ansys 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 pm
Nick Jankowski
SubscriberHello,
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 pm
Nick Jankowski
SubscriberGot it working! Had to do some rearranging
-
- The topic ‘Post-Processing Stress Using APDL’ is closed to new replies.
-
3276
-
1036
-
1004
-
859
-
798
© 2025 Copyright ANSYS, Inc. All rights reserved.