What is the new way to work with Worksheet Named Selection from the 2020R2?

Chemsdine CHEMAI
Chemsdine CHEMAI Member, Employee Posts: 201
First Anniversary Ansys Employee Solution Developer Community of Practice Member 5 Likes
edited June 2023 in Structures

What is the new way to work with Worksheet Named Selection from the 2020R2?

Tagged:

Answers

  • Chemsdine CHEMAI
    Chemsdine CHEMAI Member, Employee Posts: 201
    First Anniversary Ansys Employee Solution Developer Community of Practice Member 5 Likes
    Answer ✓

    Before the 2020R2 :

    NS = Model.AddNamedSelection() 
    NS.ScopingMethod = GeometryDefineByType.Worksheet 
    NS_location = NS.Location 
    Row = NS_location.AddRow() 
    NS_location.SetEntityType(Row, NamedSelectionWorksheetEntityType.Face) 
    NS_location.SetCriterion(Row, NamedSelectionWorksheetCriterion.Location_Z) 
    NS_location.SetOperator(Row,NamedSelectionWorksheetOperator.GreaterThan) 
    NS_location.SetValue(Row,-7)
    

    From the 2020R2:

    NS = Model.AddNamedSelection() 
    NS.ScopingMethod=GeometryDefineByType.Worksheet 
    Criteria = NS.GenerationCriteria 
    Criteria.Add(None) 
    Criteria[0].EntityType = SelectionType.GeoFace 
    Criteria[0].Criterion = SelectionCriterionType.LocationZ 
    Criteria[0].Operator = SelectionOperatorType.GreaterThan 
    Criteria[0].Value = Quantity(“-7 [m]”)
    
  • Pierre Thieffry
    Pierre Thieffry Member, Moderator, Employee Posts: 95
    First Anniversary Ansys Employee Solution Developer Community of Practice Member Photogenic
    Answer ✓

    And don’t forget NS.Generate()