CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS

Ansys - AddToSelection By Body Name.

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2012, 12:21
Default Ansys - AddToSelection By Body Name.
New Member
Aleksei Kazakov
Join Date: Aug 2012
Posts: 1
Rep Power: 0
eexak17 is on a distinguished road
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;
// Select all entities
// 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

var array_length=PartID.length;

// 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( )) {
SM.AddToSelection(part_id, topo_id, true);
eexak17 is offline   Reply With Quote


ansys, javascript mistake, scripting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluid structure interaction jnattia Main CFD Forum 25 May 21, 2015 09:16
How find Drag coefficient of a body with ANSYS CFX Jhonathan CFX 2 October 2, 2008 18:07
Exporting results from CFX to ANSYS ?? sohail ahmed CFX 1 December 20, 2007 01:10
demo free flow blunt body in cfx ansys 11 jan CFX 1 July 31, 2007 19:44
allowable body size in ANSYS Workbench 8.1 Atit Koonsrisuk CFX 1 January 5, 2005 12:40

All times are GMT -4. The time now is 01:36.