|
[Sponsors] |
August 23, 2012, 13:21 |
Ansys - AddToSelection By Body Name.
|
#1 |
New Member
Aleksei Kazakov
Join Date: Aug 2012
Posts: 1
Rep Power: 0 |
I am trying to make a function that will select all bodies with the predefined name. Unfortunately I am novice in Ansys and eventually have made a mistake which I can't identify. Could you please assist me with that? Do you know a good debugger to advice?
function main2(name){ var target_name=name; SM.Clear(); // Select all entities SC.doEditSelectAll(); // Number of selected bodies var num_selected_bodies = SM.Parts; var num_selected_entities = SM.SelectedCount; // Arrays to save IDs var PartID = new Array(); var TopoID=new Array(); var j=0; // Loop through selection and store IDs for (i=1;i=num_selected_entities;i++) { var entityTopoId = SM.SelectedEntityTopoID(i); if (entityTopoId >=3221225473) {//For bodies only TopoID[j]=SM.SelectedEntityTopoID(i); PartID[j]=SM.SelectedPartID(i); j++; }} var array_length=PartID.length; SM.Clear(); // Loop through parts by IDs for (i=0;i=array_length;i++) { var part = SM.PartMgr.PartById(PartID[i]); if (part.Name.toLowerCase()==target_name.toLowerCase( )) { part_id=PartID[i]; topo_id=TopoID[i]; SM.AddToSelection(part_id, topo_id, true); }}} |
|
Tags |
ansys, javascript mistake, scripting |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluid structure interaction | jnattia | Main CFD Forum | 25 | May 21, 2015 10:16 |
How find Drag coefficient of a body with ANSYS CFX | Jhonathan | CFX | 2 | October 2, 2008 19:07 |
Exporting results from CFX to ANSYS ?? | sohail ahmed | CFX | 1 | December 20, 2007 02:10 |
demo free flow blunt body in cfx ansys 11 | jan | CFX | 1 | July 31, 2007 20:44 |
allowable body size in ANSYS Workbench 8.1 | Atit Koonsrisuk | CFX | 1 | January 5, 2005 13:40 |