|
[Sponsors] |
[DesignModeler] DesignModeler Scripting: Direction vector in extrude command |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 19, 2015, 05:56 |
DesignModeler Scripting: Direction vector in extrude command
|
#1 |
New Member
Join Date: Apr 2015
Posts: 2
Rep Power: 0 |
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 |
|
June 23, 2015, 20:25 |
|
#2 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
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"; 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(); 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); Hope it helps Cheers KAPI |
|
July 27, 2015, 08:49 |
|
#3 |
New Member
Join Date: Apr 2015
Posts: 2
Rep Power: 0 |
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 |
|
July 27, 2015, 19:36 |
|
#4 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Thanks Tobias_H,
we learn new things everyday! Cheers KAPI |
|
Tags |
api, designmodeler, extrude |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Design Modeler Direction Reference (extrude) | natantyt | ANSYS Meshing & Geometry | 0 | June 22, 2011 12:17 |
[Gmsh] Cannot get the right mesh from gmsh | JinBiao | OpenFOAM Meshing & Mesh Conversion | 2 | August 31, 2010 05:51 |
Z direction thickness control when using fluentMeshToFoam to extrude 2D mesh | wei_wu | OpenFOAM Running, Solving & CFD | 2 | February 1, 2009 05:15 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |
Drops injection direction via command | Julie | Siemens | 2 | October 12, 2004 09:18 |