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

[DesignModeler] Specify body for slice operation in JavaScript

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2022, 13:11
Default Specify body for slice operation in JavaScript
  #1
New Member
 
Alessandro Tassone
Join Date: Mar 2016
Posts: 4
Rep Power: 10
zethani is on a distinguished road
This is my first attempt to automate some tedious tasks with the scripting language used by DesignModeler and I struggle to understand how to manipulate some of the options in a Slice operation.

I want to create two planes from a plane of reference and apply the Slice on them to cut one specific body. I can't figure out how to specify in the script that each Slice should target just one body and not all of them.

This is my script:
Code:
var plyz = agb.GetActivePlane() ;
var rotation = 90; //required rotation from orig plane
var offset = 0.121; //offset for cutting
var pl = [];
for (i=0; i<=1; i++)
{
 pl[i] = agb.PlaneFromPlane(plyz); // take this Type
 if (pl[i])
 {
  //pl[i].Name = "Slice_Plane_" + i; // Name the new planes
  pl[i].AddTransform(agc.XformXRotate, 90); //rotate
  pl[i].AddTransform(agc.XformZOffset, (2*i-1)*offset); //offset
  //slice
	agb.SetActivePlane(pl[i]);
	var feature = ag.gui.CreateSlice();
	ag.gui.Commit();
	feature.PutBasePlane(pl[i]);
	ag.gui.Regen();
 }
}
I read the Scripting API section on the DesignModeler's User Guide but I didn't find very enlightening. I also tried to dig in the ANSYS source files following this discussion, but I confess that I wasn't able to get much out of it, not even locate the command to select the active body.

Hope someone can help with this problem.
Thanks in advance,

Alessandro
zethani is offline   Reply With Quote

Reply

Tags
designmodeller, scripts


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
EHD + body force + vectorCodedSource Pavithra OpenFOAM Running, Solving & CFD 2 May 17, 2021 06:32
dynamic mesh 2d problem to move body m zubair Main CFD Forum 0 March 19, 2019 07:01
can not run simulation for body sinusoidal movement between two different fluid zones M.Hodali Autodesk Simulation CFD 0 December 17, 2018 17:07
Accelerated Body Motion Simulation reza1111 Main CFD Forum 2 June 3, 2013 09:00
[Need some advise] Am I doing right?? Simulating a rotational mixer setasena STAR-CCM+ 4 March 10, 2013 10:32


All times are GMT -4. The time now is 09:24.