|
[Sponsors] |
September 4, 2021, 15:19 |
Named Selection Script
|
#1 |
New Member
Ali
Join Date: Aug 2021
Posts: 4
Rep Power: 5 |
Hi Everybody
I'm new to Ansys Scripting. I'm working on Mechanical Model environment. I've created named selection using worksheet as following code. Code:
# Name Selection Body sel = Model.AddNamedSelection() sel.ScopingMethod=GeometryDefineByType.Worksheet sel.Name = "Oil" OilC = sel.GenerationCriteria OilC.Add(None) OilC[0].EntityType=SelectionType.GeoBody OilC[0].Criterion=SelectionCriterionType.Name OilC[0].Operator=SelectionOperatorType.Equal OilC[0].Value="FVe" OilC.Add(None) OilC[1].EntityType=SelectionType.GeoBody OilC[1].Criterion=SelectionCriterionType.Name OilC[1].Operator=SelectionOperatorType.Equal OilC[1].Value="Core" OilC.Add(None) OilC[2].EntityType=SelectionType.GeoBody OilC[2].Criterion=SelectionCriterionType.Name OilC[2].Operator=SelectionOperatorType.Equal OilC[2].Value="Box" sel.Generate() Code:
msh = Model.Mesh m_1 = msh.AddSizing() m_1.Location = "select Name selection Parts Code" thanks in advance for your Help and time. |
|
September 12, 2021, 16:08 |
Named Selection Script
|
#2 |
New Member
Ali
Join Date: Aug 2021
Posts: 4
Rep Power: 5 |
I finally found the code thanks to this website
for whom are interested in scripting Code:
msh = Model.Mesh Named_selections = DataModel.GetObjectsByName("NAME") #get name selection by its name m_6 = msh.AddSizing() m_6.Location = Named_selections[0] #choose The location m_6.ElementSize = Quantity(str(18)+"[mm]") |
|
Tags |
ansys, mesh, python, scripts |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 114 | August 23, 2023 06:37 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
[DesignModeler] Script create Named Selection and Suppress | arpeedesign | ANSYS Meshing & Geometry | 0 | July 7, 2016 04:25 |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |