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

[DesignModeler] DesignModeler Scripting: Direction vector in extrude command

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 19, 2015, 04:56
Default DesignModeler Scripting: Direction vector in extrude command
  #1
New Member
 
Join Date: Apr 2015
Posts: 2
Rep Power: 0
Tobias_H is on a distinguished road
I want to extrude a surface body in global x direction by Designmodeler scripting. Unfortunately, the direction vector cannot be specified in the API-command:

Designmodeler Users' Guide:
Extrude(Operation, BaseObject, Direction, Extent, Depth, Extent2, Depth2, Walled, Thin1, Thin2)

However, in Designmodeler's GUI it's very easy to specify the direction vector:
GUI.png

Does anyone know how to solve this problem?

Best regards

Tobias
Tobias_H is offline   Reply With Quote

Old   June 23, 2015, 19:25
Default
  #2
Senior Member
 
Join Date: Apr 2014
Location: On holidays till mid Oct'15!
Posts: 278
Rep Power: 4
Kapi is on a distinguished road
Hi Tobias,

I have never used it but you can give this a try.
After defining Extrude and before Regenration you mite have to add the below code.
But before you could do use that, you have to named select the 2D edge ("EDGE1") you want to use to call it in script.

Code:
ag.listview.ActivateItem("Direction Vector");
agb.ClearSelections();
ag.edgePick;
agb.AddSelect(agc.TypeEdge3d, EDGE1);
ag.listview.ItemValue = "Apply";
So basically your code should look like this:

Code:
//Define Extrude
var Extrude1 = agb.Extrude(agc.Cut, ps5.Sk5, agc.DirSymmetric,
agc.ExtentThruAll, 0.0, agc.ExtentFixed, 0.0, agc.No, 0.0, 0.0);

//Define Direction Vector
ag.listview.ActivateItem("Direction Vector");
agb.ClearSelections();
ag.edgePick;
agb.AddSelect(agc.TypeEdge3d, EDGE1);
ag.listview.ItemValue = "Apply";

//Regenerate
agb.Regen();
You can try the below mentioned code to do Named selection:

Code:
var EDGE1 = ag.m.ModelEdges(1); //you have to find out what number edge you want as your 2D edge
agb.AddSelect(agc.TypeEdge3d, Edge1);
if you want to change Direction vector you need to call that particular Edge which you want to specify in Direction Vector.

Hope it helps

Cheers
KAPI
Kapi is offline   Reply With Quote

Old   July 27, 2015, 07:49
Default
  #3
New Member
 
Join Date: Apr 2015
Posts: 2
Rep Power: 0
Tobias_H is on a distinguished road
Dear Kapi,

thank you for this solution. I found out that it's also possible to set the direction vector by the command
extrude_obj.SetDirection(x,y,z).

#### Code example #####
var ext1 = agb.Extrude(agc.Add, ps1.Sk1, agc.DirNormal, agc.ExtentFixed, 3.5,
agc.ExtentFixed, 0.0, agc.No, 0.0, 0.0);
ext1.SetDirection(0.5,0.5,0.5);
agb.Regen(); //To insure model validity
######################


Best regards

Tobias
Tobias_H is offline   Reply With Quote

Old   July 27, 2015, 18:36
Default
  #4
Senior Member
 
Join Date: Apr 2014
Location: On holidays till mid Oct'15!
Posts: 278
Rep Power: 4
Kapi is on a distinguished road
Thanks Tobias_H,

we learn new things everyday!

Cheers
KAPI
Kapi is offline   Reply With Quote

Reply

Tags
api, designmodeler, extrude

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Modeler Direction Reference (extrude) natantyt ANSYS Meshing & Geometry 0 June 22, 2011 11:17
Cannot get the right mesh from gmsh JinBiao Open Source Meshers: Gmsh, Netgen, CGNS, ... 2 August 31, 2010 04:51
Z direction thickness control when using fluentMeshToFoam to extrude 2D mesh wei_wu OpenFOAM Running, Solving & CFD 2 February 1, 2009 05:15
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Drops injection direction via command Julie CD-adapco 2 October 12, 2004 08:18


All times are GMT -4. The time now is 06:13.