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

[DesignModeler] [DesignModeler] Pattern Function does not work,why?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Kapi

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 11, 2017, 01:43
Question [DesignModeler] Pattern Function does not work,why?
  #1
New Member
 
LC
Join Date: Jun 2017
Posts: 6
Rep Power: 8
Vallence is on a distinguished road
Hi,everyone!
The following js code is a simple DesignModeler example.I want to body2 pattern around YAxis. But it does not work. How to set pattern axis?

var XYPlane = agb.GetXYPlane();
agb.SetActivePlane (XYPlane);

function planeSketchesOnly (p)
{

//Plane
p.Plane = agb.GetActivePlane();
p.Origin = p.Plane.GetOrigin();
p.XAxis = p.Plane.GetXAxis();
p.YAxis = p.Plane.GetYAxis();

//Sketch1
p.Sk1 = p.Plane.NewSketch();
p.Sk1.Name = "Sketch";

//Edges
with (p.Sk1)
{
a=10
b=20
h=20
p.Ln11 = Line(a,0,b,0);
p.Ln12 = Line(b,0,b,h);
p.Ln13 = Line(b,h,a,h);
p.Ln14 = Line(a,h,a,0);
}
edge1=p.Ln14;

//Sketch2
p.Sk2 = p.Plane.NewSketch();
p.Sk2.Name = "Sketch2";

//Edges
with (p.Sk2)
{
a=15
b=24
h=10
h0=12
p.Ln21 = Line(a,h0,b,h0);
p.Ln22 = Line(b,h0,b,h0+h);
p.Ln23 = Line(b,h0+h,a,h+h0);
p.Ln24 = Line(a,h+h0,a,h0);
}


//Dimensions and/or constraints
with (p.Plane)
{

}
p.Plane.EvalDimCons(); //Final evaluate of all dimensions and constraints in plane
return p;
} //End Plane JScript function: planeSketchesOnly

//Call Plane JScript function
var ps1 = planeSketchesOnly (new Object());

//BODY1
var MyRevolve1 = agb.Revolve(agc.Add,
ps1.Sk1,
ps1.YAxis,
agc.DirNormal,
360.0,
0.0,
agc.No,
0.0,
0.0);
agb.Regen();

//BODY2
var MyRevolve2 = agb.Revolve(agc.Frozen,
ps1.Sk2,
ps1.YAxis,
agc.DirNormal,
3.0,
0.0,
agc.No,
0.0,
0.0);
agb.Regen(); //To insure model validity


var MyPattern = ag.gui.CreatePattern();
MyPattern.Name="Pattern1";
ag.listview.ActivateItem("Pattern Type");
ag.listview.ItemValue = "Circular";

ag.listview.ActivateItem("Geometry");
agb.ClearSelections();
body1 = ag.fm.Body(1);
agb.AddSelect(agc.TypeBody, body1);
ag.listview.ItemValue = "Apply";


//==============================
ag.listview.ActivateItem("Axis");
//ag.bodyPick;
ag.edgePick; //These two methods have been tried, No Pass!
ag.gui.SelectAll();
ag.listview.ItemValue = "Apply";
//============================
ag.listview.ActivateItem("FD2, Angle");
ag.listview.ItemValue = "Evently Spaced";

ag.listview.ActivateItem("FD3, Copies (>=0)");
ag.listview.ItemValue = "8";
agb.Regen();

Last edited by Vallence; June 13, 2017 at 21:51.
Vallence is offline   Reply With Quote

 

Tags
axis, pattern


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
Lets talk about relaxation factor optimization chriss85 OpenFOAM Running, Solving & CFD 35 June 21, 2019 09:54
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 06:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 12:32.