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

[DesignModeler] scripting a circular pattern

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

Like Tree2Likes
  • 1 Post By Kapi
  • 1 Post By Kapi

Reply
 
LinkBack Thread Tools Display Modes
Old   July 21, 2015, 11:35
Default scripting a circular pattern
  #1
New Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 12
Rep Power: 6
efirvida is on a distinguished road
Hi, how is the code to perform a circular pattern on a design modeler script
thanks for the help
efirvida is offline   Reply With Quote

Old   July 21, 2015, 23:59
Default
  #2
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 231
Rep Power: 4
Kapi is on a distinguished road
Hi efirvida,

May be this is what you are after.

Code:
ag.gui.CreatePattern();
Cheers
KAPI
Kapi is offline   Reply With Quote

Old   July 22, 2015, 21:30
Default
  #3
New Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 12
Rep Power: 6
efirvida is on a distinguished road
Quote:
Originally Posted by Kapi View Post
Hi efirvida,

May be this is what you are after.

Code:
ag.gui.CreatePattern();
Cheers
KAPI
thank for your reply, but how do I use it for a circular pattern?
efirvida is offline   Reply With Quote

Old   July 22, 2015, 22:40
Default
  #4
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 231
Rep Power: 4
Kapi is on a distinguished road
Quote:
thank for your reply, but how do I use it for a circular pattern?
You may activate pattern type first and then pick circular, something like this:
Code:
var Pat = ag.gui.CreatePattern();
Pat.Operation = 2;
Make sure you do named selection of body you want to pattern as say "geom1" and also Named select the 3D edge you want to use as direction as say "edge1"

add this code after the above code:
Code:
ag.listview.ActivateItem("Geometry");
agb.AddSelect(agc.TypeBody, geom1);
ag.listview.ItemValue = "Apply";

ag.listview.ActivateItem("Direction");
agb.AddSelect(agc.TypeEdge3d, edge1);
ag.listview.ItemValue = "Apply";
Hope it helps,

Cheers
KAPI
efirvida likes this.

Last edited by Kapi; July 23, 2015 at 00:07.
Kapi is offline   Reply With Quote

Old   July 23, 2015, 19:31
Default
  #5
New Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 12
Rep Power: 6
efirvida is on a distinguished road
Hi Kapi thank for your interest in help me, I have probles with the selection of the geometry and the axis, i donīt know how to create a named selection when I create the pattern manually y use the XYplane on the axis selection but here did'nt work, here is my full code
thanks again

Code:
function planeSketchesOnly (p)
{

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

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

//Edges
with (p.Sk1)
{
  p.Sp1 = SplineBegin();
  with(p.Sp1)
  {
    SplineFlexibility = agc.Yes;
    SplineXY(-3.52229224726, 24.4980806866);
    SplineXY(-3.26871549058, 24.5332019729);
    SplineXY(-3.01478903209, 24.5656985875);
    SplineXY(-2.76054003799, 24.5955670538);
    SplineXY(-2.50599570897, 24.6228041763);
    SplineXY(-2.49401470291, 24.6242160344);
    SplineXY(-2.48208455134, 24.6260074955);
    SplineXY(-2.47021727842, 24.6281767542);
    SplineXY(-2.45842484494, 24.6307216239);
    SplineXY(-2.44671913625, 24.6336395399);
    SplineXY(-2.4351119503, 24.6369275611);
    SplineXY(-2.42361498574, 24.6405823738);
    SplineXY(-2.41223983013, 24.6446002942);
    SplineXY(-2.40099794826, 24.6489772727);
    SplineXY(-2.38990067059, 24.653708898);
    SplineXY(-2.37895918185, 24.6587904011);
    SplineXY(-2.36818450974, 24.6642166605);
    SplineXY(-2.35758751384, 24.669982207);
    SplineXY(-2.34717887465, 24.6760812299);
    SplineXY(-2.33696908282, 24.6825075819);
    SplineXY(-2.3269684286, 24.6892547861);
    SplineXY(-2.31718699144, 24.6963160421);
    SplineXY(-2.30763462986, 24.7036842331);
    SplineXY(-2.29832097149, 24.7113519327);
    SplineXY(-2.28925540339, 24.7193114128);
    SplineXY(-2.28044706254, 24.7275546513);
    SplineXY(-2.27190482671, 24.73607334);
    SplineXY(-2.26363730543, 24.744858893);
    SplineXY(-2.25565283139, 24.7539024555);
    SplineXY(-2.24795945196, 24.7631949128);
    SplineXY(-2.24056492116, 24.7727268992);
    SplineXY(-2.23347669177, 24.7824888075);
    SplineXY(-2.22670190788, 24.7924707989);
    SplineXY(-2.22024739767, 24.8026628128);
    SplineXY(-2.21411966649, 24.8130545768);
    SplineXY(-2.20832489037, 24.8236356174);
    SplineXY(-2.20286890975, 24.83439527);
    SplineXY(-2.1977572236, 24.8453226903);
    SplineXY(-2.19299498388, 24.8564068647);
    SplineXY(-2.18858699037, 24.8676366217);
    SplineXY(-2.18453768578, 24.8790006431);
    SplineXY(-2.18085115133, 24.8904874753);
    SplineXY(-2.1775311026, 24.9020855409);
    SplineXY(-2.17458088581, 24.9137831505);
    SplineXY(-2.17200347441, 24.9255685143);
    SplineXY(-2.16980146614, 24.9374297541);
    SplineXY(-2.16797708034, 24.9493549151);
    SplineXY(-2.16653215578, 24.9613319783);
    SplineXY(-2.16546814878, 24.9733488722);
    SplineXY(-2.16478613171, 24.9853934852);
    SplineXY(-2.16448679198, 24.9974536777);
    SplineXY(-2.16457043128, 25.0095172947);
    SplineXY(-2.16503696532, 25.0215721773);
    SplineXY(-2.16588592388, 25.0336061758);
    SplineXY(-2.22746689477, 25.7453674724);
    SplineXY(-2.22949543619, 25.787353411);
    SplineXY(-2.23020097312, 25.8294535177);
    SplineXY(-2.23004110788, 25.8716279037);
    SplineXY(-2.22917823596, 25.9138622212);
    SplineXY(-2.22770576366, 25.956148091);
    SplineXY(-2.22568641914, 25.998479788);
    SplineXY(-2.22316603879, 26.0408530485);
    SplineXY(-2.22017997247, 26.0832645156);
    SplineXY(-2.21675652908, 26.1257114416);
    SplineXY(-2.21291901951, 26.1681915111);
    SplineXY(-2.20868705573, 26.2107027283);
    SplineXY(-2.20407742191, 26.2532433422);
    SplineXY(-2.19910468332, 26.2958117934);
    SplineXY(-2.19378162651, 26.3384066762);
    SplineXY(-2.18811958652, 26.3810267103);
    SplineXY(-2.18212869581, 26.4236707195);
    SplineXY(-2.17581807746, 26.4663376144);
    SplineXY(-2.16919599773, 26.5090263798);
    SplineXY(-2.16226998824, 26.5517360639);
    SplineXY(-2.1550469453, 26.5944657695);
    SplineXY(-2.1475332114, 26.6372146474);
    SplineXY(-2.13973464296, 26.6799818901);
    SplineXY(-2.131656667, 26.7227667271);
    SplineXY(-2.12330432914, 26.7655684209);
    SplineXY(-2.11468233434, 26.8083862631);
    SplineXY(-2.10579508199, 26.8512195716);
    SplineXY(-2.09664669606, 26.8940676882);
    SplineXY(-2.08724105135, 26.9369299759);
    SplineXY(-2.07758179641, 26.979805817);
    SplineXY(-2.06767237356, 27.0226946117);
    SplineXY(-2.05751603666, 27.0655957764);
    SplineXY(-2.04711586673, 27.1085087421);
    SplineXY(-2.03647478589, 27.1514329534);
    SplineXY(-2.02559556984, 27.1943678677);
    SplineXY(-2.01448085887, 27.2373129535);
    SplineXY(-2.00313316799, 27.2802676905);
    SplineXY(-1.99155489582, 27.3232315679);
    SplineXY(-1.9797483328, 27.3662040843);
    SplineXY(-1.96771566854, 27.4091847469);
    SplineXY(-1.95545899854, 27.4521730709);
    SplineXY(-1.94298033029, 27.4951685789);
    SplineXY(-1.93028158885, 27.5381708005);
    SplineXY(-1.91736462193, 27.5811792719);
    SplineXY(-1.90423120462, 27.6241935355);
    SplineXY(-1.89088304365, 27.6672131392);
    SplineXY(-1.87732178138, 27.7102376368);
    SplineXY(-1.86354899946, 27.7532665867);
    SplineXY(-1.84956622216, 27.7962995525);
    SplineXY(-1.83537491955, 27.8393361022);
    SplineXY(-1.8209765104, 27.8823758082);
    SplineXY(-1.80637236483, 27.9254182469);
    SplineXY(-1.79156380685, 27.9684629985);
    SplineXY(-1.7765521167, 28.0115096471);
    SplineXY(-1.76133853298, 28.0545577801);
    SplineXY(-1.74592425474, 28.0976069881);
    SplineXY(-1.73031044335, 28.140656865);
    SplineXY(-1.71449822429, 28.1837070078);
    SplineXY(-1.6984886888, 28.226757016);
    SplineXY(-1.68228289546, 28.269806492);
    SplineXY(-1.66588187168, 28.3128550409);
    SplineXY(-1.64928661503, 28.35590227);
    SplineXY(-1.63249809461, 28.3989477892);
    SplineXY(-1.61551725222, 28.4419912105);
    SplineXY(-1.59834500354, 28.485032148);
    SplineXY(-1.58098223924, 28.5280702181);
    SplineXY(-1.56342982598, 28.5711050388);
    SplineXY(-1.54568860742, 28.6141362304);
    SplineXY(-1.52775940511, 28.6571634146);
    SplineXY(-1.50964301939, 28.7001862151);
    SplineXY(-1.49134023022, 28.7432042573);
    SplineXY(-1.47285179796, 28.7862171678);
    SplineXY(-1.45417846413, 28.8292245753);
    SplineXY(-1.43532095208, 28.8722261094);
    SplineXY(-1.41627996774, 28.9152214016);
    SplineXY(-1.39705620021, 28.9582100844);
    SplineXY(-1.37765032237, 29.0011917919);
    SplineXY(-1.35806299149, 29.0441661591);
    SplineXY(-1.33829484979, 29.0871328226);
    SplineXY(-1.31834652493, 29.1300914198);
    SplineXY(-1.29821863056, 29.1730415896);
    SplineXY(-1.2779117668, 29.2159829717);
    SplineXY(-1.25742652066, 29.2589152068);
    SplineXY(-1.23676346655, 29.3018379369);
    SplineXY(-1.21592316665, 29.3447508048);
    SplineXY(-1.19490617131, 29.3876534541);
    SplineXY(-1.17371301952, 29.4305455296);
    SplineXY(-1.15234423916, 29.4734266768);
    SplineXY(-1.13080034746, 29.516296542);
    SplineXY(-1.10908185129, 29.5591547724);
    SplineXY(-1.0871892475, 29.602001016);
    SplineXY(-1.06512302322, 29.6448349215);
    SplineXY(-1.04288365622, 29.6876561385);
    SplineXY(-1.02047161511, 29.730464317);
    SplineXY(-0.997887359704, 29.7732591081);
    SplineXY(-0.975131341229, 29.8160401631);
    SplineXY(-0.952204002621, 29.8588071344);
    SplineXY(-0.929105778759, 29.9015596748);
    SplineXY(-0.905837096704, 29.9442974377);
    SplineXY(-0.882398375933, 29.9870200771);
    SplineXY(-0.835848177838, 29.9883537031);
    SplineXY(-0.789423204286, 29.9896117181);
    SplineXY(-0.742996338872, 29.9907978627);
    SplineXY(-0.696567692858, 29.9919121339);
    SplineXY(-0.650137377512, 29.9929545292);
    SplineXY(-0.603705504104, 29.993925046);
    SplineXY(-0.557272183908, 29.994823682);
    SplineXY(-0.510837528202, 29.995650435);
    SplineXY(-0.464401648269, 29.9964053031);
    SplineXY(-0.417964655391, 29.9970882845);
    SplineXY(-0.371526660856, 29.9976993775);
    SplineXY(-0.325087775953, 29.9982385806);
    SplineXY(-0.278648111973, 29.9987058926);
    SplineXY(-0.23220778021, 29.9991013123);
    SplineXY(-0.185766891958, 29.9994248389);
    SplineXY(-0.139325558514, 29.9996764714);
    SplineXY(-0.0928838911735, 29.9998562094);
    SplineXY(-0.0464420012362, 29.9999640523);
    SplineXY(0.0, 30.0);
    SplineXY(-0.0, 30.0);
    SplineXY(0.0464420012362, 29.9999640523);
    SplineXY(0.0928838911735, 29.9998562094);
    SplineXY(0.139325558514, 29.9996764714);
    SplineXY(0.185766891958, 29.9994248389);
    SplineXY(0.23220778021, 29.9991013123);
    SplineXY(0.278648111973, 29.9987058926);
    SplineXY(0.325087775953, 29.9982385806);
    SplineXY(0.371526660856, 29.9976993775);
    SplineXY(0.417964655391, 29.9970882845);
    SplineXY(0.464401648269, 29.9964053031);
    SplineXY(0.510837528202, 29.995650435);
    SplineXY(0.557272183908, 29.994823682);
    SplineXY(0.603705504104, 29.993925046);
    SplineXY(0.650137377512, 29.9929545292);
    SplineXY(0.696567692858, 29.9919121339);
    SplineXY(0.742996338872, 29.9907978627);
    SplineXY(0.789423204286, 29.9896117181);
    SplineXY(0.835848177838, 29.9883537031);
    SplineXY(0.882398375933, 29.9870200771);
    SplineXY(0.905837096704, 29.9442974377);
    SplineXY(0.929105778759, 29.9015596748);
    SplineXY(0.952204002621, 29.8588071344);
    SplineXY(0.975131341229, 29.8160401631);
    SplineXY(0.997887359704, 29.7732591081);
    SplineXY(1.02047161511, 29.730464317);
    SplineXY(1.04288365622, 29.6876561385);
    SplineXY(1.06512302322, 29.6448349215);
    SplineXY(1.0871892475, 29.602001016);
    SplineXY(1.10908185129, 29.5591547724);
    SplineXY(1.13080034746, 29.516296542);
    SplineXY(1.15234423916, 29.4734266768);
    SplineXY(1.17371301952, 29.4305455296);
    SplineXY(1.19490617131, 29.3876534541);
    SplineXY(1.21592316665, 29.3447508048);
    SplineXY(1.23676346655, 29.3018379369);
    SplineXY(1.25742652066, 29.2589152068);
    SplineXY(1.2779117668, 29.2159829717);
    SplineXY(1.29821863056, 29.1730415896);
    SplineXY(1.31834652493, 29.1300914198);
    SplineXY(1.33829484979, 29.0871328226);
    SplineXY(1.35806299149, 29.0441661591);
    SplineXY(1.37765032237, 29.0011917919);
    SplineXY(1.39705620021, 28.9582100844);
    SplineXY(1.41627996774, 28.9152214016);
    SplineXY(1.43532095208, 28.8722261094);
    SplineXY(1.45417846413, 28.8292245753);
    SplineXY(1.47285179796, 28.7862171678);
    SplineXY(1.49134023022, 28.7432042573);
    SplineXY(1.50964301939, 28.7001862151);
    SplineXY(1.52775940511, 28.6571634146);
    SplineXY(1.54568860742, 28.6141362304);
    SplineXY(1.56342982598, 28.5711050388);
    SplineXY(1.58098223924, 28.5280702181);
    SplineXY(1.59834500354, 28.485032148);
    SplineXY(1.61551725222, 28.4419912105);
    SplineXY(1.63249809461, 28.3989477892);
    SplineXY(1.64928661503, 28.35590227);
    SplineXY(1.66588187168, 28.3128550409);
    SplineXY(1.68228289546, 28.269806492);
    SplineXY(1.6984886888, 28.226757016);
    SplineXY(1.71449822429, 28.1837070078);
    SplineXY(1.73031044335, 28.140656865);
    SplineXY(1.74592425474, 28.0976069881);
    SplineXY(1.76133853298, 28.0545577801);
    SplineXY(1.7765521167, 28.0115096471);
    SplineXY(1.79156380685, 27.9684629985);
    SplineXY(1.80637236483, 27.9254182469);
    SplineXY(1.8209765104, 27.8823758082);
    SplineXY(1.83537491955, 27.8393361022);
    SplineXY(1.84956622216, 27.7962995525);
    SplineXY(1.86354899946, 27.7532665867);
    SplineXY(1.87732178138, 27.7102376368);
    SplineXY(1.89088304365, 27.6672131392);
    SplineXY(1.90423120462, 27.6241935355);
    SplineXY(1.91736462193, 27.5811792719);
    SplineXY(1.93028158885, 27.5381708005);
    SplineXY(1.94298033029, 27.4951685789);
    SplineXY(1.95545899854, 27.4521730709);
    SplineXY(1.96771566854, 27.4091847469);
    SplineXY(1.9797483328, 27.3662040843);
    SplineXY(1.99155489582, 27.3232315679);
    SplineXY(2.00313316799, 27.2802676905);
    SplineXY(2.01448085887, 27.2373129535);
    SplineXY(2.02559556984, 27.1943678677);
    SplineXY(2.03647478589, 27.1514329534);
    SplineXY(2.04711586673, 27.1085087421);
    SplineXY(2.05751603666, 27.0655957764);
    SplineXY(2.06767237356, 27.0226946117);
    SplineXY(2.07758179641, 26.979805817);
    SplineXY(2.08724105135, 26.9369299759);
    SplineXY(2.09664669606, 26.8940676882);
    SplineXY(2.10579508199, 26.8512195716);
    SplineXY(2.11468233434, 26.8083862631);
    SplineXY(2.12330432914, 26.7655684209);
    SplineXY(2.131656667, 26.7227667271);
    SplineXY(2.13973464296, 26.6799818901);
    SplineXY(2.1475332114, 26.6372146474);
    SplineXY(2.1550469453, 26.5944657695);
    SplineXY(2.16226998824, 26.5517360639);
    SplineXY(2.16919599773, 26.5090263798);
    SplineXY(2.17581807746, 26.4663376144);
    SplineXY(2.18212869581, 26.4236707195);
    SplineXY(2.18811958652, 26.3810267103);
    SplineXY(2.19378162651, 26.3384066762);
    SplineXY(2.19910468332, 26.2958117934);
    SplineXY(2.20407742191, 26.2532433422);
    SplineXY(2.20868705573, 26.2107027283);
    SplineXY(2.21291901951, 26.1681915111);
    SplineXY(2.21675652908, 26.1257114416);
    SplineXY(2.22017997247, 26.0832645156);
    SplineXY(2.22316603879, 26.0408530485);
    SplineXY(2.22568641914, 25.998479788);
    SplineXY(2.22770576366, 25.956148091);
    SplineXY(2.22917823596, 25.9138622212);
    SplineXY(2.23004110788, 25.8716279037);
    SplineXY(2.23020097312, 25.8294535177);
    SplineXY(2.22949543619, 25.787353411);
    SplineXY(2.22746689477, 25.7453674724);
    SplineXY(2.16588592388, 25.0336061758);
    SplineXY(2.16503696532, 25.0215721773);
    SplineXY(2.16457043128, 25.0095172947);
    SplineXY(2.16448679198, 24.9974536777);
    SplineXY(2.16478613171, 24.9853934852);
    SplineXY(2.16546814878, 24.9733488722);
    SplineXY(2.16653215578, 24.9613319783);
    SplineXY(2.16797708034, 24.9493549151);
    SplineXY(2.16980146614, 24.9374297541);
    SplineXY(2.17200347441, 24.9255685143);
    SplineXY(2.17458088581, 24.9137831505);
    SplineXY(2.1775311026, 24.9020855409);
    SplineXY(2.18085115133, 24.8904874753);
    SplineXY(2.18453768578, 24.8790006431);
    SplineXY(2.18858699037, 24.8676366217);
    SplineXY(2.19299498388, 24.8564068647);
    SplineXY(2.1977572236, 24.8453226903);
    SplineXY(2.20286890975, 24.83439527);
    SplineXY(2.20832489037, 24.8236356174);
    SplineXY(2.21411966649, 24.8130545768);
    SplineXY(2.22024739767, 24.8026628128);
    SplineXY(2.22670190788, 24.7924707989);
    SplineXY(2.23347669177, 24.7824888075);
    SplineXY(2.24056492116, 24.7727268992);
    SplineXY(2.24795945196, 24.7631949128);
    SplineXY(2.25565283139, 24.7539024555);
    SplineXY(2.26363730543, 24.744858893);
    SplineXY(2.27190482671, 24.73607334);
    SplineXY(2.28044706254, 24.7275546513);
    SplineXY(2.28925540339, 24.7193114128);
    SplineXY(2.29832097149, 24.7113519327);
    SplineXY(2.30763462986, 24.7036842331);
    SplineXY(2.31718699144, 24.6963160421);
    SplineXY(2.3269684286, 24.6892547861);
    SplineXY(2.33696908282, 24.6825075819);
    SplineXY(2.34717887465, 24.6760812299);
    SplineXY(2.35758751384, 24.669982207);
    SplineXY(2.36818450974, 24.6642166605);
    SplineXY(2.37895918185, 24.6587904011);
    SplineXY(2.38990067059, 24.653708898);
    SplineXY(2.40099794826, 24.6489772727);
    SplineXY(2.41223983013, 24.6446002942);
    SplineXY(2.42361498574, 24.6405823738);
    SplineXY(2.4351119503, 24.6369275611);
    SplineXY(2.44671913625, 24.6336395399);
    SplineXY(2.45842484494, 24.6307216239);
    SplineXY(2.47021727842, 24.6281767542);
    SplineXY(2.48208455134, 24.6260074955);
    SplineXY(2.49401470291, 24.6242160344);
    SplineXY(2.50599570897, 24.6228041763);
    SplineXY(2.76054003799, 24.5955670538);
    SplineXY(3.01478903209, 24.5656985875);
    SplineXY(3.26871549058, 24.5332019729);
    SplineXY(3.52229224726, 24.4980806866);
    
    SplineFitPtEnd();
  }
  p.Ln2 = Line(-3.52229224726, 24.4980806866, -2.49050966978,17.3218752329);

  p.Ln3 = Line(2.49050966978, 17.3218752329, 3.52229224726, 24.4980806866);
  p.Cr4 = ArcCtrEdge(
              0, 0,
              2.49050966978, 17.3218752329,
              -2.49050966978, 17.3218752329);
  p.Ext11 = agb.Extrude(agc.Add, p.Sk1, agc.DirNormal, agc.ExtentFixe, 34.0, agc.ExtentFixed, 0.0, agc.No, 0.0, 0.0);
  p.Ext11.Name = "TOOTH"
}  

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

ag.listview.ActivateItem("Geometry");
agb.AddSelect(agc.TypeBody, p.Ext11);
ag.listview.ItemValue = "Apply";

ag.listview.ActivateItem("Axis");
agb.AddSelect(agc.TypePlane, agb.GetXYPlane());
ag.listview.ItemValue = "Apply";

ag.listview.ActivateItem("FD2, Angle");
ag.listview.ItemValue = "16.32323232";

ag.listview.ActivateItem("FD3, Copies (>0)");
ag.listview.ItemValue = "22";

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

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());

//Finish
agb.Regen(); //To insure model validity
//End DM JScript
efirvida is offline   Reply With Quote

Old   July 24, 2015, 01:21
Default
  #6
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 231
Rep Power: 4
Kapi is on a distinguished road
HI efirvida,

Since you have 1 body, you dont have to named select it.
Just pick it by the below code and then "Apply"

Code:
ag.bodyPick;
ag.gui.SelectAll(); 
ag.listview.ItemValue = "Apply";
Regarding Axis: "TypePlane" is not a entity to select planes. There are other options to select plane. Debug it and click on "agc." and you shall see option starting plane.

May I add that you need to regenerate before starting pattern command.
Code:
agb.Regen();

Hope it helps

Cheers
KAPI
efirvida likes this.
Kapi is offline   Reply With Quote

Old   July 24, 2015, 17:26
Default
  #7
New Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 12
Rep Power: 6
efirvida is on a distinguished road
Hi Kapi thank for your help finally I did it, follow your instructions combined with the trial and error method , Now I know how the API more or less

Code:
var PF1 = ag.gui.CreateSpot();
ag.listview.ActivateItem("Type");
ag.listview.ItemValue = "Construction Point";
ag.listview.ActivateItem("Definition");
ag.listview.ItemValue = "Manual Input";
ag.listview.ActivateItem("FD8, X Coordinate");
ag.listview.ItemValue = "0";
ag.listview.ActivateItem("FD9, Y Coordinate");
ag.listview.ItemValue = "0";
ag.listview.ActivateItem("FD10, Z Coordinate");
ag.listview.ItemValue = "0";
agb.Regen();

var PF2 = ag.gui.CreateSpot();
ag.listview.ActivateItem("Type");
ag.listview.ItemValue = "Construction Point";
ag.listview.ActivateItem("Definition");
ag.listview.ItemValue = "Manual Input";
ag.listview.ActivateItem("FD8, X Coordinate");
ag.listview.ItemValue = "0";
ag.listview.ActivateItem("FD9, Y Coordinate");
ag.listview.ItemValue = "0";
ag.listview.ActivateItem("FD10, Z Coordinate");
ag.listview.ItemValue = "34.0";
agb.Regen();

var LF1 = agb.LinePt();
LF1.AddSegment(PF1.GetPoint(1, 0),PF2.GetPoint(1, 0), 0);
agb.Regen();

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

ag.listview.ActivateItem("Geometry");
ag.bodyPick;
ag.gui.SelectAll();
ag.listview.ItemValue = "Apply";

ag.listview.ActivateItem("Axis");
ag.edgePick;
ag.gui.SelectAll();
ag.listview.ItemValue = "Apply";

ag.listview.ActivateItem("FD2, Angle");
ag.listview.ItemValue = "16.3636363636";

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

Now I have 2 questions,
first how to create and select features when I have more than one, I'm going to need this soon, to include the other gear, if you have some example wold be helpfully to me
secondly in your previous answer you mention somethig about debug my script, how can I do that I would be very useful for me, I didn't know it was possible debug ansys scripts

many thanks again
Efirvida
efirvida is offline   Reply With Quote

Old   July 26, 2015, 18:40
Default
  #8
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 231
Rep Power: 4
Kapi is on a distinguished road
Hi efirvida,

I dont understand what you mean by
Quote:
first how to create and select features when I have more than one,
bit more information is needed!

in your script add a line "Debugger" at the start or in between, it will debug your code and you can see values of variables and other things.
You need to have Visual Studio for that!

Cheers
KAPI
Kapi is offline   Reply With Quote

Reply

Tags
circular pattern, scripting

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
wave pattern problem running LTSInterFoam Alex song OpenFOAM Running, Solving & CFD 2 May 10, 2015 03:14
[DesignModeler] Circular pattern - Turbomachinery Far ANSYS Meshing & Geometry 4 April 29, 2013 04:51
benchmark: flow over a circular cylinder goodegg Main CFD Forum 12 January 22, 2013 12:47
flow over a cylinder urgent! kevin FLUENT 7 June 8, 2006 01:19
conjugate heat transfer in circular channel src FLUENT 1 August 6, 2004 07:13


All times are GMT -4. The time now is 23:58.