


{"id":165078,"date":"2021-12-23T14:25:36","date_gmt":"2021-12-23T14:25:36","guid":{"rendered":"\/forum\/forums\/topic\/set-up-a-named-selection-referencing-to-other\/"},"modified":"2022-01-11T06:59:19","modified_gmt":"2022-01-11T06:59:19","slug":"set-up-a-named-selection-referencing-to-other","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/set-up-a-named-selection-referencing-to-other\/","title":{"rendered":"Set up a Named Selection referencing to other"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>I&acute;m trying to write a python script for set up Named Selection<\/p>\n<p>My first try is the following short script:<\/p>\n<p>sel=DataModel.Project.Model.AddNamedSelection()<\/p>\n<p>sel.ScopingMethod=GeometryDefineByType.Worksheet<\/p>\n<p>sel.Name=&quot;Groove Edges&quot; <\/p>\n<p>CRC=sel.GenerationCriteria<\/p>\n<p>CRC.Add(None)<\/p>\n<p>CRC[0]=Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion()<\/p>\n<p>CRC[0].Action=SelectionActionType.Add<\/p>\n<p>CRC[0].EntityType=SelectionType.GeoEdge<\/p>\n<p>CRC[0].Criterion=SelectionCriterionType.NamedSelection<\/p>\n<p>CRC[0].Operator=SelectionOperatorType.Equal<\/p>\n<p>CRC[0].Value=ExtAPI.DataModel.Project.Model.NamedSelections.Children[3]<\/p>\n<p>sel.Generate()<\/p>\n<p><\/p>\n<\/p>\n<p>It generate a new Named Selection from the NS list. <\/p>\n<p>But I want to set the value to a name like &quot;NS_Edge_groove_01&quot;.<\/p>\n<p><\/p>\n<p><\/p>\n<\/p>\n<p>Can someone help?<\/p>\n","protected":false},"template":"","class_list":["post-165078","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":[""],"_bbp_old_reply_author_name_id":["Anonymous"],"_bbp_old_is_reply_anonymous_id":["false"],"_btv_view_count":["2580"],"_bbp_likes_count":["0"],"_bbp_subscription":["243888"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["165078"],"_bbp_forum_id":["27791"],"_bbp_engagement":["200","58821","243888"],"_bbp_voice_count":["3"],"_bbp_reply_count":["3"],"_bbp_last_reply_id":["201189"],"_bbp_last_active_id":["201189"],"_bbp_last_active_time":["2022-01-11 06:59:19"]},"test":"falko-kunzegmx-net"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/165078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/165078\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=165078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}