What is the new way to work with Worksheet Named Selection from the 2020R2?
Chemsdine CHEMAI
Member, Employee Posts: 201
✭✭✭✭
Best Answers
-
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]”)
0 -
And don’t forget NS.Generate()
0
Answers
-
Just to add if we want to say remove a Planar surface/face (2023 R2):
ns=model.NamedSelections.Children myns=ns[0] myns.ScopingMethod=GeometryDefineByType.Worksheet Criteria=myns.GenerationCriteria Criteria.Add(None) index=len(Criteria)-1 Criteria[index].Action=SelectionActionType.Remove Criteria[index].EntityType = SelectionType.GeoFace Criteria[index].Criterion = SelectionCriterionType.Type Criteria[index].Operator=SelectionOperatorType.Equal Criteria[index].Value = 1 # 1 for plane, 2 cylinder, etc myns.Generate() Tree.Refresh()
0 -
Regarding the same topic:
what is the code for Value = Plane, which comes from a dropdown menu if done manually.
Example remove faces which are planes by their type0 -
I repeat my comment because the first one from yesterday did not appear.
How to set in the value column "Plane" (comes from the dropdown menu)? Quantity("Plane") does not work.
Example: remove faces whose type equals "Plane".0 -
See my answer above it is shown there (Criteria[index].Value = 1 # 1 for plane, 2 cylinder, etc).
Thank you
Erik
0