|
[Sponsors] |
[Workbench] Automating worksheet of named selections in Ansys Workbench |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 16, 2017, 20:16 |
Automating worksheet of named selections in Ansys Workbench
|
#1 |
New Member
benjamin cosatto
Join Date: Feb 2017
Location: France
Posts: 2
Rep Power: 0 |
Hi everyone,
I would like to create an automatic named selection with Jscript code in Ansys Workbench. My idea was to use a worksheet as scoping method for named selection (with different criteria). However I have some problem with the code. I don’t know how to write in my code the selection of different criteria (Action, GeometryType, Operator, Value …) and the application of “a filter” (Body, Face, Vertex … for GeometryType / Equal, NotEqual, Less Than … for Operator …) which are in the worksheet. When I tried something like the code below, I have an error message: Error 800A01C2 - Wrong number of arguments of invalid property assignment. name = "Selection_1" NS = DS.Script.addNamedSelection(false,name,DS.Script.i d_NS_Body); DS.Script.changeActiveObject(NS.ID) ListView.ActivateItem("Scoping Method"); ListView.ItemValue = "Worksheet"; NS.AddCriteriaData(); Someone have an idea ? In my opinion, I don’t have the good parameters in “addnamedselection()” but I don’t know how to do. Thank you for your help. Ben |
|
October 4, 2017, 07:00 |
|
#2 |
New Member
LLORIA
Join Date: Aug 2017
Posts: 4
Rep Power: 9 |
Hi here is your answer :
named_sel=ExtAPI.DataModel.Project.Model.AddNamedS election() named_sel.SendToSolver=0 named_sel.Location=ExtAPI.SelectionManager.CreateS electionInfo(SelectionTypeEnum.WorksheetSpecific) named_sel_WS=named_sel.Location named_sel.Name="Target_Faces_mesh_sizing_sym_entry _holes" named_sel_WS.AddRow() named_sel_WS.SetAction(0,NamedSelectionWorksheetAc tion.Add) named_sel_WS.SetEntityType(0,NamedSelectionWorkshe etEntityType.Face) named_sel_WS.SetCriterion(0,NamedSelectionWorkshee tCriterion.Location_Y) #NamedSelection Location_X named_sel_WS.SetOperator(0,NamedSelectionWorksheet Operator.GreaterThan) #Largest Smallest Equal NotEqual LessThan GreaterThan Equal named_sel_WS.SetValue(0,0.245) named_sel_WS.AddRow() named_sel_WS.SetAction(1,NamedSelectionWorksheetAc tion.Filter) named_sel_WS.SetEntityType(1,NamedSelectionWorkshe etEntityType.Face) named_sel_WS.SetCriterion(1,NamedSelectionWorkshee tCriterion.Location_Y) #NamedSelection Location_X named_sel_WS.SetOperator(1,NamedSelectionWorksheet Operator.LessThan) #Largest Smallest Equal NotEqual LessThan GreaterThan Equal named_sel_WS.SetValue(1,0.278) named_sel_WS.AddRow() named_sel_WS.SetAction(2,NamedSelectionWorksheetAc tion.Filter) named_sel_WS.SetEntityType(2,NamedSelectionWorkshe etEntityType.Face) named_sel_WS.SetCriterion(2,NamedSelectionWorkshee tCriterion.Size) named_sel_WS.SetOperator(2,NamedSelectionWorksheet Operator.LessThan) named_sel_WS.SetValue(2,0.00290) named_sel_WS.AddRow() named_sel_WS.SetAction(3,NamedSelectionWorksheetAc tion.Filter) named_sel_WS.SetEntityType(3,NamedSelectionWorkshe etEntityType.Face) named_sel_WS.SetCriterion(3,NamedSelectionWorkshee tCriterion.Size) named_sel_WS.SetOperator(3,NamedSelectionWorksheet Operator.GreaterThan) named_sel_WS.SetValue(3,0.00280) named_sel_WS.Generate() |
|
March 9, 2019, 11:14 |
Automatic selection script gives the error.... Help Please
|
#3 | |
New Member
Danish
Join Date: Jan 2012
Posts: 4
Rep Power: 14 |
Hello experts,
I am trying to access the named selection automation script given by LLORIA but when I run it in ANSYS MESH, it mentions the error shown in the picture. I want to create 100s of named selection (faces/volumes) to assign boundary conditions systematically. Thanks for your help in advance. Quote:
|
||
March 12, 2019, 04:31 |
|
#4 |
Member
Baris PULAT
Join Date: Sep 2016
Location: Italy
Posts: 59
Rep Power: 10 |
I am not an expert in ANSYS ACT but the script originally posted by LLORIA looks to be an ACT code.
Therefore, it is not going to work with ANSYS run macro utility which uses JScript. |
|
Tags |
namedselection, scripting, worksheet |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
only 1 of many named selections not showing up in cfx pre | mihirbhagat | CFX | 2 | April 26, 2019 05:56 |
Can you help me with a problem in ansys static structural solver? | sourabh.porwal | Structural Mechanics | 0 | March 27, 2016 18:07 |
2way FSI with Ansys workbench | lingdeer | ANSYS | 3 | May 9, 2013 04:48 |
Gambit vs. Ansys workbench mesh generating | sanlee39 | Main CFD Forum | 2 | April 8, 2013 07:09 |
[ANSYS Meshing] Missing Named Selections | kschong | ANSYS Meshing & Geometry | 3 | June 4, 2012 05:04 |