CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > ANSYS Meshing & Geometry

[ANSYS Meshing] Scripting

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Talayal

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 21, 2016, 01:39
Default Scripting
  #1
New Member
 
Talay
Join Date: Nov 2010
Posts: 6
Rep Power: 15
Talayal is on a distinguished road
Hi,

I am trying to access a body in meshing via scripting however I am a bit confused about the idea of partID and TopoID.

I am currently using a loop like;

Code:
var partID = new Array ();
var TopoId = new Array ();

SM.Clear();
SM.SelectAll();


for (var i= 1; i<=SM.SelectedCount; i++) {
    partID[i] = DS.SelectionManager.SelectedPartID(i);
    TopoId[i] = DS.SelectionManager.SelectedEntityTopoID(i);

	}
And expect it to write partID and TopoID's of every body that is in "DS.Tree.FirstActiveBranch.Model.PrototypeGrou p". I can call for partID[1] & TopoID[1] correctly however for any other body I am failing. Which makes me think that my understanding of the concept of part & topo id's are wrong.

The main goal is to sort the contents of PrototypeGroup according to bodies (surface or body). And select either one at specific locations.

I also did try;
Code:
var part = DS.Tree.FirstActiveBranch.PrototypeGroup.Prototypes(1).Part;

var partID = part.ID;

var brep = part.BRep;

var face = brep.Cells(1);
which failed me. Apparently Topo_ID is not an ordered integer, I mean first bodies topo id is not "1"...

So I need a bit of guidance here..
Talayal is offline   Reply With Quote

Old   December 21, 2016, 05:41
Default Solution
  #2
New Member
 
Talay
Join Date: Nov 2010
Posts: 6
Rep Power: 15
Talayal is on a distinguished road
Hi,

Let me answer my own question..

Code:
var branch = DS.Tree.FirstActiveBranch;
var bodies = branch.Prototypes;

for (var i=1; i<=bodies.Count; i++) {
SM.Clear();
SM.ForceSelect(bodies(i).Part.ID, bodies(i).topoID);
}
One can change "i" anywhere to access individual body..
Luiz Pancini likes this.
Talayal is offline   Reply With Quote

Reply

Tags
mesh script access body


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
[ICEM] ICEM Scripting Issues tylerplowright ANSYS Meshing & Geometry 33 September 27, 2021 16:35
Macro scripting in netbeans, importing star libraries laurensvd STAR-CCM+ 3 October 31, 2020 22:06
Glyph Scripting Origin pdp.aero Pointwise & Gridgen 3 July 9, 2015 16:57
record actions via scripting Marabelle ANSYS 0 July 31, 2013 11:57
[DesignModeler] change import by scripting dragonwei ANSYS Meshing & Geometry 0 September 17, 2012 05:08


All times are GMT -4. The time now is 20:08.