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

[DesignModeler] how to use design modeler api to create 3D path for extrude sweep?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2015, 01:48
Default how to use design modeler api to create 3D path for extrude sweep?
  #1
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 53
Rep Power: 16
efirvida is on a distinguished road
I'm trying to create a helical gear using ANSYS Design Modeler API Script to make parametric gears studies. but i don't know how to perform a extrude with twisted helix of the gear. I think that maybe using extrude sweep along the 3D path but i don't know how to do that thing.

i found some function in agConstants.js, agEventHandler.js that maybe has the solution but i don't know how to use them

ag.c.FPointManual() and ag.gui.CreateCurve()

Any ideas?

this is my script file:

Code:
ag.m.ClearAllErrors();
ag.gui.setUnits(ag.c.UnitMillimeter, ag.c.UnitDegree, ag.c.No);

function planeSketchesOnly(p) {
    p.Plane = agb.GetActivePlane();
    p.Origin = p.Plane.GetOrigin();
    p.XAxis = p.Plane.GetXAxis();
    p.YAxis = p.Plane.GetYAxis();

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

    with (p.Sk1) {
        p.Sp1 = SplineBegin();
        with (p.Sp1) {
            SplineFlexibility = agc.Yes;
            SplineXY(-3.68001045894, 25.5950349436);
            SplineXY(-3.42237476775, 25.6307557768);
            SplineXY(-3.16439280942, 25.6638833556);
            SplineXY(-2.90609068591, 25.6944143282);
            SplineXY(-2.64749453156, 25.7223456055);
            SplineXY(-2.6355102317, 25.7237717668);
            SplineXY(-2.62357726557, 25.7255777841);
            SplineXY(-2.61170767003, 25.7277618356);
            SplineXY(-2.59991341805, 25.7303217182);
            SplineXY(-2.58820640656, 25.7332548498);
            SplineXY(-2.57659844453, 25.7365582718);
            SplineXY(-2.56510124098, 25.7402286518);
            SplineXY(-2.55372639325, 25.7442622877);
            SplineXY(-2.54248537522, 25.7486551106);
            SplineXY(-2.53138952579, 25.7534026894);
            SplineXY(-2.52045003744, 25.7585002352);
            SplineXY(-2.5096779449, 25.7639426062);
            SplineXY(-2.49908411407, 25.7697243124);
            SplineXY(-2.48867923103, 25.775839522);
            SplineXY(-2.47847379126, 25.7822820664);
            SplineXY(-2.46847808907, 25.789045447);
            SplineXY(-2.45870220719, 25.7961228414);
            SplineXY(-2.44915600664, 25.8035071108);
            SplineXY(-2.43984911673, 25.8111908065);
            SplineXY(-2.43079092541, 25.8191661779);
            SplineXY(-2.42199056973, 25.8274251802);
            SplineXY(-2.41345692668, 25.8359594825);
            SplineXY(-2.40519860422, 25.8447604761);
            SplineXY(-2.39722393257, 25.8538192835);
            SplineXY(-2.38954095584, 25.8631267669);
            SplineXY(-2.38215742393, 25.8726735379);
            SplineXY(-2.37508078464, 25.8824499665);
            SplineXY(-2.36831817624, 25.8924461911);
            SplineXY(-2.36187642022, 25.9026521285);
            SplineXY(-2.35576201444, 25.9130574839);
            SplineXY(-2.34998112653, 25.9236517613);
            SplineXY(-2.34453958773, 25.9344242742);
            SplineXY(-2.33944288696, 25.9453641563);
            SplineXY(-2.33469616529, 25.9564603725);
            SplineXY(-2.33030421079, 25.9677017298);
            SplineXY(-2.32627145364, 25.9790768891);
            SplineXY(-2.32260196173, 25.9905743761);
            SplineXY(-2.3192994365, 26.0021825933);
            SplineXY(-2.31636720922, 26.0138898314);
            SplineXY(-2.31380823767, 26.0256842811);
            SplineXY(-2.31162510309, 26.0375540453);
            SplineXY(-2.30982000762, 26.0494871509);
            SplineXY(-2.30839477209, 26.0614715609);
            SplineXY(-2.30735083414, 26.0734951865);
            SplineXY(-2.30668924679, 26.0855458994);
            SplineXY(-2.30641067739, 26.0976115439);
            SplineXY(-2.30651540695, 26.1096799494);
            SplineXY(-2.30700332981, 26.1217389423);
            SplineXY(-2.3078739538, 26.1337763587);
            SplineXY(-2.35353848388, 26.6508698571);
            SplineXY(-2.35573103068, 26.6948235467);
            SplineXY(-2.35653088459, 26.7388999069);
            SplineXY(-2.35641970237, 26.7830560841);
            SplineXY(-2.355568405, 26.8272766657);
            SplineXY(-2.35407529686, 26.8715526517);
            SplineXY(-2.35200639181, 26.9158778935);
            SplineXY(-2.34940992444, 26.9602478122);
            SplineXY(-2.34632309208, 27.0046588035);
            SplineXY(-2.34277568143, 27.0491079173);
            SplineXY(-2.3387922189, 27.0935926681);
            SplineXY(-2.33439333795, 27.1381109136);
            SplineXY(-2.32959669592, 27.1826607743);
            SplineXY(-2.32441761496, 27.2272405768);
            SplineXY(-2.31886954529, 27.2718488127);
            SplineXY(-2.31296440962, 27.3164841083);
            SplineXY(-2.3067128651, 27.3611452017);
            SplineXY(-2.30012450669, 27.4058309242);
            SplineXY(-2.29320802768, 27.4505401869);
            SplineXY(-2.28597134837, 27.4952719688);
            SplineXY(-2.27842172047, 27.5400253079);
            SplineXY(-2.27056581302, 27.5847992933);
            SplineXY(-2.26240978355, 27.6295930593);
            SplineXY(-2.25395933782, 27.6744057796);
            SplineXY(-2.24521978024, 27.7192366635);
            SplineXY(-2.23619605688, 27.7640849515);
            SplineXY(-2.22689279224, 27.8089499126);
            SplineXY(-2.21731432111, 27.8538308409);
            SplineXY(-2.20746471611, 27.8987270538);
            SplineXY(-2.19734781182, 27.9436378892);
            SplineXY(-2.18696722591, 27.9885627044);
            SplineXY(-2.17632637777, 28.0335008736);
            SplineXY(-2.16542850497, 28.0784517872);
            SplineXY(-2.15427667796, 28.1234148502);
            SplineXY(-2.14287381312, 28.1683894808);
            SplineXY(-2.13122268445, 28.2133751097);
            SplineXY(-2.11932593414, 28.2583711793);
            SplineXY(-2.10718608199, 28.3033771424);
            SplineXY(-2.094805534, 28.3483924618);
            SplineXY(-2.08218659015, 28.3934166094);
            SplineXY(-2.06933145143, 28.4384490658);
            SplineXY(-2.05624222625, 28.4834893197);
            SplineXY(-2.04292093637, 28.528536867);
            SplineXY(-2.02936952221, 28.5735912109);
            SplineXY(-2.01558984781, 28.6186518612);
            SplineXY(-2.00158370534, 28.6637183337);
            SplineXY(-1.98735281927, 28.7087901502);
            SplineXY(-1.97289885024, 28.7538668379);
            SplineXY(-1.9582233986, 28.7989479292);
            SplineXY(-1.94332800767, 28.8440329615);
            SplineXY(-1.92821416685, 28.8891214766);
            SplineXY(-1.91288331441, 28.9342130209);
            SplineXY(-1.89733684013, 28.9793071449);
            SplineXY(-1.88157608779, 29.0244034029);
            SplineXY(-1.86560235741, 29.0695013531);
            SplineXY(-1.84941690742, 29.114600557);
            SplineXY(-1.83302095665, 29.1597005796);
            SplineXY(-1.81641568622, 29.2048009893);
            SplineXY(-1.79960224126, 29.2499013573);
            SplineXY(-1.78258173258, 29.2950012577);
            SplineXY(-1.76535523822, 29.3401002674);
            SplineXY(-1.7479238049, 29.385197966);
            SplineXY(-1.73028844938, 29.4302939357);
            SplineXY(-1.71245015977, 29.475387761);
            SplineXY(-1.69440989672, 29.5204790285);
            SplineXY(-1.67616859461, 29.5655673274);
            SplineXY(-1.65772716261, 29.6106522488);
            SplineXY(-1.63908648569, 29.6557333858);
            SplineXY(-1.62024742564, 29.7008103334);
            SplineXY(-1.60121082195, 29.7458826887);
            SplineXY(-1.58197749271, 29.7909500503);
            SplineXY(-1.56254823542, 29.8360120186);
            SplineXY(-1.54292382779, 29.8810681957);
            SplineXY(-1.52310502848, 29.9261181852);
            SplineXY(-1.50309257782, 29.9711615923);
            SplineXY(-1.48288719849, 30.0161980235);
            SplineXY(-1.46248959613, 30.0612270868);
            SplineXY(-1.44190046001, 30.1062483917);
            SplineXY(-1.42112046357, 30.1512615486);
            SplineXY(-1.400150265, 30.1962661696);
            SplineXY(-1.37899050777, 30.2412618677);
            SplineXY(-1.35764182114, 30.2862482572);
            SplineXY(-1.33610482064, 30.3312249534);
            SplineXY(-1.31438010854, 30.3761915727);
            SplineXY(-1.29246827429, 30.4211477328);
            SplineXY(-1.27036989497, 30.466093052);
            SplineXY(-1.24808553566, 30.5110271498);
            SplineXY(-1.22561574986, 30.5559496466);
            SplineXY(-1.20296107986, 30.6008601638);
            SplineXY(-1.18012205708, 30.6457583235);
            SplineXY(-1.15709920246, 30.6906437487);
            SplineXY(-1.13389302673, 30.7355160633);
            SplineXY(-1.11050403078, 30.7803748919);
            SplineXY(-1.08693270594, 30.8252198599);
            SplineXY(-1.06317953429, 30.8700505935);
            SplineXY(-1.03924498891, 30.9148667195);
            SplineXY(-1.01512953422, 30.9596678655);
            SplineXY(-0.990833626137, 31.0044536596);
            SplineXY(-0.966357712436, 31.0492237309);
            SplineXY(-0.941702232922, 31.0939777088);
            SplineXY(-0.892016671242, 31.0954427385);
            SplineXY(-0.842472665099, 31.0968244787);
            SplineXY(-0.792926520379, 31.0981272809);
            SplineXY(-0.743378362852, 31.0993511421);
            SplineXY(-0.693828318293, 31.100496059);
            SplineXY(-0.644276512484, 31.1015620287);
            SplineXY(-0.594723071209, 31.1025490485);
            SplineXY(-0.545168120257, 31.103457116);
            SplineXY(-0.495611785421, 31.1042862288);
            SplineXY(-0.446054192498, 31.1050363849);
            SplineXY(-0.396495467288, 31.1057075823);
            SplineXY(-0.346935735592, 31.1062998192);
            SplineXY(-0.297375123215, 31.1068130943);
            SplineXY(-0.247813755966, 31.1072474062);
            SplineXY(-0.198251759654, 31.1076027538);
            SplineXY(-0.148689260088, 31.1078791362);
            SplineXY(-0.0991263830819, 31.1080765527);
            SplineXY(-0.049563254448, 31.1081950028);
            SplineXY(0.0, 31.1082344862);
            SplineXY(-0.0, 31.1082344862);
            SplineXY(0.049563254448, 31.1081950028);
            SplineXY(0.0991263830819, 31.1080765527);
            SplineXY(0.148689260088, 31.1078791362);
            SplineXY(0.198251759654, 31.1076027538);
            SplineXY(0.247813755966, 31.1072474062);
            SplineXY(0.297375123215, 31.1068130943);
            SplineXY(0.346935735592, 31.1062998192);
            SplineXY(0.396495467288, 31.1057075823);
            SplineXY(0.446054192498, 31.1050363849);
            SplineXY(0.495611785421, 31.1042862288);
            SplineXY(0.545168120257, 31.103457116);
            SplineXY(0.594723071209, 31.1025490485);
            SplineXY(0.644276512484, 31.1015620287);
            SplineXY(0.693828318293, 31.100496059);
            SplineXY(0.743378362852, 31.0993511421);
            SplineXY(0.792926520379, 31.0981272809);
            SplineXY(0.842472665099, 31.0968244787);
            SplineXY(0.892016671242, 31.0954427385);
            SplineXY(0.941702232922, 31.0939777088);
            SplineXY(0.966357712436, 31.0492237309);
            SplineXY(0.990833626137, 31.0044536596);
            SplineXY(1.01512953422, 30.9596678655);
            SplineXY(1.03924498891, 30.9148667195);
            SplineXY(1.06317953429, 30.8700505935);
            SplineXY(1.08693270594, 30.8252198599);
            SplineXY(1.11050403078, 30.7803748919);
            SplineXY(1.13389302673, 30.7355160633);
            SplineXY(1.15709920246, 30.6906437487);
            SplineXY(1.18012205708, 30.6457583235);
            SplineXY(1.20296107986, 30.6008601638);
            SplineXY(1.22561574986, 30.5559496466);
            SplineXY(1.24808553566, 30.5110271498);
            SplineXY(1.27036989497, 30.466093052);
            SplineXY(1.29246827429, 30.4211477328);
            SplineXY(1.31438010854, 30.3761915727);
            SplineXY(1.33610482064, 30.3312249534);
            SplineXY(1.35764182114, 30.2862482572);
            SplineXY(1.37899050777, 30.2412618677);
            SplineXY(1.400150265, 30.1962661696);
            SplineXY(1.42112046357, 30.1512615486);
            SplineXY(1.44190046001, 30.1062483917);
            SplineXY(1.46248959613, 30.0612270868);
            SplineXY(1.48288719849, 30.0161980235);
            SplineXY(1.50309257782, 29.9711615923);
            SplineXY(1.52310502848, 29.9261181852);
            SplineXY(1.54292382779, 29.8810681957);
            SplineXY(1.56254823542, 29.8360120186);
            SplineXY(1.58197749271, 29.7909500503);
            SplineXY(1.60121082195, 29.7458826887);
            SplineXY(1.62024742564, 29.7008103334);
            SplineXY(1.63908648569, 29.6557333858);
            SplineXY(1.65772716261, 29.6106522488);
            SplineXY(1.67616859461, 29.5655673274);
            SplineXY(1.69440989672, 29.5204790285);
            SplineXY(1.71245015977, 29.475387761);
            SplineXY(1.73028844938, 29.4302939357);
            SplineXY(1.7479238049, 29.385197966);
            SplineXY(1.76535523822, 29.3401002674);
            SplineXY(1.78258173258, 29.2950012577);
            SplineXY(1.79960224126, 29.2499013573);
            SplineXY(1.81641568622, 29.2048009893);
            SplineXY(1.83302095665, 29.1597005796);
            SplineXY(1.84941690742, 29.114600557);
            SplineXY(1.86560235741, 29.0695013531);
            SplineXY(1.88157608779, 29.0244034029);
            SplineXY(1.89733684013, 28.9793071449);
            SplineXY(1.91288331441, 28.9342130209);
            SplineXY(1.92821416685, 28.8891214766);
            SplineXY(1.94332800767, 28.8440329615);
            SplineXY(1.9582233986, 28.7989479292);
            SplineXY(1.97289885024, 28.7538668379);
            SplineXY(1.98735281927, 28.7087901502);
            SplineXY(2.00158370534, 28.6637183337);
            SplineXY(2.01558984781, 28.6186518612);
            SplineXY(2.02936952221, 28.5735912109);
            SplineXY(2.04292093637, 28.528536867);
            SplineXY(2.05624222625, 28.4834893197);
            SplineXY(2.06933145143, 28.4384490658);
            SplineXY(2.08218659015, 28.3934166094);
            SplineXY(2.094805534, 28.3483924618);
            SplineXY(2.10718608199, 28.3033771424);
            SplineXY(2.11932593414, 28.2583711793);
            SplineXY(2.13122268445, 28.2133751097);
            SplineXY(2.14287381312, 28.1683894808);
            SplineXY(2.15427667796, 28.1234148502);
            SplineXY(2.16542850497, 28.0784517872);
            SplineXY(2.17632637777, 28.0335008736);
            SplineXY(2.18696722591, 27.9885627044);
            SplineXY(2.19734781182, 27.9436378892);
            SplineXY(2.20746471611, 27.8987270538);
            SplineXY(2.21731432111, 27.8538308409);
            SplineXY(2.22689279224, 27.8089499126);
            SplineXY(2.23619605688, 27.7640849515);
            SplineXY(2.24521978024, 27.7192366635);
            SplineXY(2.25395933782, 27.6744057796);
            SplineXY(2.26240978355, 27.6295930593);
            SplineXY(2.27056581302, 27.5847992933);
            SplineXY(2.27842172047, 27.5400253079);
            SplineXY(2.28597134837, 27.4952719688);
            SplineXY(2.29320802768, 27.4505401869);
            SplineXY(2.30012450669, 27.4058309242);
            SplineXY(2.3067128651, 27.3611452017);
            SplineXY(2.31296440962, 27.3164841083);
            SplineXY(2.31886954529, 27.2718488127);
            SplineXY(2.32441761496, 27.2272405768);
            SplineXY(2.32959669592, 27.1826607743);
            SplineXY(2.33439333795, 27.1381109136);
            SplineXY(2.3387922189, 27.0935926681);
            SplineXY(2.34277568143, 27.0491079173);
            SplineXY(2.34632309208, 27.0046588035);
            SplineXY(2.34940992444, 26.9602478122);
            SplineXY(2.35200639181, 26.9158778935);
            SplineXY(2.35407529686, 26.8715526517);
            SplineXY(2.355568405, 26.8272766657);
            SplineXY(2.35641970237, 26.7830560841);
            SplineXY(2.35653088459, 26.7388999069);
            SplineXY(2.35573103068, 26.6948235467);
            SplineXY(2.35353848388, 26.6508698571);
            SplineXY(2.3078739538, 26.1337763587);
            SplineXY(2.30700332981, 26.1217389423);
            SplineXY(2.30651540695, 26.1096799494);
            SplineXY(2.30641067739, 26.0976115439);
            SplineXY(2.30668924679, 26.0855458994);
            SplineXY(2.30735083414, 26.0734951865);
            SplineXY(2.30839477209, 26.0614715609);
            SplineXY(2.30982000762, 26.0494871509);
            SplineXY(2.31162510309, 26.0375540453);
            SplineXY(2.31380823767, 26.0256842811);
            SplineXY(2.31636720922, 26.0138898314);
            SplineXY(2.3192994365, 26.0021825933);
            SplineXY(2.32260196173, 25.9905743761);
            SplineXY(2.32627145364, 25.9790768891);
            SplineXY(2.33030421079, 25.9677017298);
            SplineXY(2.33469616529, 25.9564603725);
            SplineXY(2.33944288696, 25.9453641563);
            SplineXY(2.34453958773, 25.9344242742);
            SplineXY(2.34998112653, 25.9236517613);
            SplineXY(2.35576201444, 25.9130574839);
            SplineXY(2.36187642022, 25.9026521285);
            SplineXY(2.36831817624, 25.8924461911);
            SplineXY(2.37508078464, 25.8824499665);
            SplineXY(2.38215742393, 25.8726735379);
            SplineXY(2.38954095584, 25.8631267669);
            SplineXY(2.39722393257, 25.8538192835);
            SplineXY(2.40519860422, 25.8447604761);
            SplineXY(2.41345692668, 25.8359594825);
            SplineXY(2.42199056973, 25.8274251802);
            SplineXY(2.43079092541, 25.8191661779);
            SplineXY(2.43984911673, 25.8111908065);
            SplineXY(2.44915600664, 25.8035071108);
            SplineXY(2.45870220719, 25.7961228414);
            SplineXY(2.46847808907, 25.789045447);
            SplineXY(2.47847379126, 25.7822820664);
            SplineXY(2.48867923103, 25.775839522);
            SplineXY(2.49908411407, 25.7697243124);
            SplineXY(2.5096779449, 25.7639426062);
            SplineXY(2.52045003744, 25.7585002352);
            SplineXY(2.53138952579, 25.7534026894);
            SplineXY(2.54248537522, 25.7486551106);
            SplineXY(2.55372639325, 25.7442622877);
            SplineXY(2.56510124098, 25.7402286518);
            SplineXY(2.57659844453, 25.7365582718);
            SplineXY(2.58820640656, 25.7332548498);
            SplineXY(2.59991341805, 25.7303217182);
            SplineXY(2.61170767003, 25.7277618356);
            SplineXY(2.62357726557, 25.7255777841);
            SplineXY(2.6355102317, 25.7237717668);
            SplineXY(2.64749453156, 25.7223456055);
            SplineXY(2.90609068591, 25.6944143282);
            SplineXY(3.16439280942, 25.6638833556);
            SplineXY(3.42237476775, 25.6307557768);
            SplineXY(3.68001045894, 25.5950349436);

            SplineFitPtEnd();
        }
        p.Ln2 = Line(-3.68001045894, 25.5950349436, -2.49050966978, 17.3218752329);

        p.Ln3 = Line(2.49050966978, 17.3218752329, 3.68001045894, 25.5950349436);
        p.Cr4 = ArcCtrEdge(
            0, 0,
            2.49050966978, 17.3218752329,
            -2.49050966978, 17.3218752329);
    }

    ag.selectedFeature = ag.gui.TreeviewFeature(p.Sk1.Name, 0);
    var SSk1 = ag.gui.CreateSurfSk();  // IAnsFSurfSk
    SSk1.Name = "Gear";
    SSk1.Operation = ag.c.Frozen;
    SSk1.WithPlaneNormal = ag.c.Yes;


    p.Plane.EvalDimCons();

    return p;
}

var ps1 = planeSketchesOnly(new Object());

agb.Regen();
efirvida is offline   Reply With Quote

Old   May 3, 2015, 23:33
Default
  #2
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
Hi efirvida,

Could you please tell the manual process you are doing and which profile you are selection to create this gear?

Are you able to create gear manually?
If yes then please post pictures of process how you are making a Helical gear and what profile and path you are selection manually!

Cheers
KAPI
Kapi is offline   Reply With Quote

Old   May 4, 2015, 16:11
Default
  #3
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 53
Rep Power: 16
efirvida is on a distinguished road
Hi!! first of all thanks for help me.

yes I'm able to create the gear manually, well not all the gear one tooth is enough for me.

1- create a profile of the tooth using the previous posted script, this create a sketch named "Gear"


if i want to create a spur gear a simply extrude command will be sufficient for this profile, but for helical gear its needed extrude and twist at the same time, but design modeler doesn't have this capability. then...

2- to extrude and twist the profile at the same time, maybe i can use sweep tool
create the path for the sweep using Design Modeler>Concept>3D Curve. Details view, assign "From Coordinates File" on the Definition option and use file with the coords of the path for example (not real coords file, the real ones are not calculated yet)

coords.txt
Code:
        1 1 0.0  17.5 0.0
        1 2 2.0  15.5 10.0
        1 3 4.0  13.5 15.0
        1 4 6.0  11.5 20.0
        1 5 8.0  9.5 25.0
        1 6 10.0 7.5 30.0


3- finally use sweep to extrude the sketch "Gear" along the 3D Curve.


this is the manual procedure, but for my script i don't want to use an external coordinate file to create the 3D Curve, i want to have all on a single script file
Attached Images
File Type: jpg 1.jpg (63.2 KB, 133 views)
File Type: jpg 2.jpg (64.1 KB, 129 views)
File Type: jpg 3.jpg (66.2 KB, 130 views)
File Type: jpg 4.jpg (69.6 KB, 129 views)
efirvida is offline   Reply With Quote

Old   May 4, 2015, 20:50
Default
  #4
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
Hi efirvida,

You can create curve from the following function using coordinate file
Code:
var Cr1 = ag.gui.CreateCurve();
Cr1.Name = "FileName";
Cr1.CoordinateFile = "FilePath";
agb.Regen();
I am trying to figure out how to create curve directly from the script itself so that you dont need to call any coordinate file. Will let you know as soon as I figure out.

For Twisted sweep with Pitch you can use below code.

Code:
var sweep1 = agb.Sweep(agc.Add, ps1.Sk1, ps1.Sk1, agc.AlignTangent, 1.0, 2.0, agc.No, 0.0, 0.0);
agb.Regen();
You can add below code if you want to add values.

Code:
sweep1.Name = "GearSweep";
sweep1.Scale = 0.1;
sweep1.Turns = 1.0;
sweep1.Walled = agc.No;
sweep1.Thin1 = 0.0;
sweep1.Thin2 = 1.0;
agb.Regen();
Hope it helps

Cheers
KAPI
Kapi is offline   Reply With Quote

Old   May 5, 2015, 15:17
Default
  #5
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 53
Rep Power: 16
efirvida is on a distinguished road
hi thanks again,
but that didn't work, i change your code

Code:
var sweep1 = agb.Sweep(agc.Add, ps1.Sk1, ps1.Sk1, agc.AlignTangent, 1.0, 2.0, agc.No, 0.0, 0.0);
for:

Code:
var sweep1 = agb.Sweep(agc.Add, p.Sk1, Cr1, agc.AlignTangent, 1.0, 2.0, agc.No, 0.0, 0.0);
but the sweep feature doesn't recognize the path Cr1.
Do any progress with the non coordinate file curve?
efirvida is offline   Reply With Quote

Old   May 5, 2015, 23:30
Default
  #6
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
Hi efirvida,

In one of the JS files I found this:
Quote:
to change the path of the sweep. The path should be a sketch,
plane outline, or named selection and not the same as the profile
You are creating a 3D curve and referencing it in the path thats why its not working.
So I guess you need to do Named Selection of Curve and then specify the Named Selection in place of "Cr1" in Sweep Function

ps: I havent figured out how to create curve within JS

Hope it helps

Cheers
KAPI
Kapi is offline   Reply With Quote

Old   May 6, 2015, 00:00
Default
  #7
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 53
Rep Power: 16
efirvida is on a distinguished road
Quote:
Originally Posted by Kapi View Post
So I guess you need to do Named Selection of Curve and then specify the Named Selection in place of "Cr1" in Sweep Function
how would I do that?
thanks!
efirvida is offline   Reply With Quote

Old   May 6, 2015, 01:18
Default
  #8
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
Hi efirvida,

Quote:
how would I do that?
I haven't used it yet so guess we both need to look into function to create NamedSelection automatically.

Search JS files for the answer and I shall do the same!

Cheers
KAPI
Kapi is offline   Reply With Quote

Old   May 20, 2015, 04:21
Default
  #9
Member
 
Max
Join Date: May 2015
Posts: 48
Rep Power: 11
USER1234 is on a distinguished road
Quote:
Originally Posted by Kapi View Post
I haven't used it yet so guess we both need to look into function to create NamedSelection automatically.

Search JS files for the answer and I shall do the same!

Cheers
KAPI
Hi,

could you find anything for scripting a NamedSelection?

Best regards

Max
USER1234 is offline   Reply With Quote

Old   May 20, 2015, 20:25
Default
  #10
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
Hi User,

You can select body/face/edge and then use this function for named selection
Code:
ag.gui.CreateSelectionSet();
Cheers
KAPI
Kapi is offline   Reply With Quote

Reply


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
Design Modeler siavash ghassemi CFX 3 August 5, 2015 20:15
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 02:07
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Design Modeler to ICEM..... Joe CFX 0 January 24, 2008 04:39
Create array/pattern in WorkBench's Design Modeler coriolius CFX 2 October 25, 2004 09:42


All times are GMT -4. The time now is 16:38.