-
-
June 21, 2021 at 6:16 pm
Stefan Schroeder
SubscriberHi,
I would like to add several faces to a named selection, based on their visibility. The numbers of faces depends on the script parameters (geometry contains parametric patterns) and all faces are related to the same body. Build-up and change of visibility works flawless, it´s just the selection that bothers me. The script is for an automated CFD-Analysis, the named selections are mandatory for meshing and setup.
sel1=FaceSelection.FilterByVisible(FaceSelection.SelectAll())
sel2=Selection.Empty()
result = NamedSelection.Create(sel1,sel2)
result = NamedSelection.Rename("Gruppe1","test")
For some reason, this method doesn´t select the remaining visible faces, but the complete body.
Where´s my mistake?
July 14, 2021 at 4:16 pmAniket Chavan
Forum ModeratorThere does not seem to be a direct way of doing this. Can you please explain in more detail what your requirement is?
If you are getting to that point interactively, you should be able to select all faces and then creating the group with the active selection.
If you are getting to that point through the script, you should have the faces stored in a variable already somewhere right?
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
July 15, 2021 at 8:34 amStefan Schroeder
SubscriberHi Aniket, thank you for your response.
It┬┤s an internal flow simulation for studying the mass flow distribution at a number of outlets. The geometry is driven by the script, including different outlet quantities (hence the changing quantities of total faces). The assigning of named selections for inlets, symmetry and outlets (using loop functions for that) by the script works well and reliable. Last step is to gather all remaining faces (= all faces unassigned to a named selection so far) and put them in a named selection called "wall".
Easy problem, but I can┬┤t figure it out!
Maybe there is some kind of boolean operation possible: [Select all faces of the body] minus [all faces already in named selections] = all remaining faces ("Wall").
But something like "test1 = FaceSelection.SelectAll()" returns the body instead of all faces.
Therefore my (desperate) approach of using the visibility as a kind of workaround.
Best regards
July 15, 2021 at 11:02 amAniket Chavan
Forum ModeratorBut, if you have created groups for other faces, you have those face objects right? You can get all the face objects to an array and remove the face objects that are already there in the group so final array will be of the faces that are remaining. Am I missing something here? Also, if I am not wrong, Fluent automatically assigns wall property to the faces which do not have a named selection.
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
July 15, 2021 at 12:04 pmStefan Schroeder
Subscriber"Also, if I am not wrong, Fluent automatically assigns wall property to the faces which do not have a named selection." <-- I was not aware of it... *facepalm*
Yeah, ok, I guess I┬┤ve overcomplicated this one... :D
Thank you very much!
Viewing 4 reply threads- The topic ‘SpaceClaim Script: Selection by Visibility’ is closed to new replies.
Innovation SpaceTrending discussionsTop Contributors-
6550
-
1906
-
1463
-
1311
-
1022
Top Rated Tags© 2026 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.
-
Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.