|
[Sponsors] |
[DesignModeler] DM script js with agb.revolve |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 8, 2015, 11:49 |
DM script js with agb.revolve
|
#1 |
New Member
Aureliano Sancho
Join Date: May 2013
Location: Salvador-Ba-Brasil
Posts: 26
Rep Power: 13 |
I want to write a script to create a sphere but can not correctly run the agb.revolver command. Please can anyone help?
Follows the script: agb.Regen (); //.................................................. .............. function planeXYSketchesOnly (p) { p.Plane = agb.GetActivePlane(); p.Origin = p.Plane.GetOrigin(); p.XAxis = p.Plane.GetXAxis(); p.YAxis = p.Plane.GetYAxis(); //.......................Primeiro Retangulo......................................... ... p.Sk1 = p.Plane.newSketch(); p.Sk1.Name = "Sketch1"; with (p.Sk1) { p.Cr1 = ArcCtrEdge(0, 0, 2.0, 0, -2.0, 0); } p.Plane.EvalDimCons(); return p; } var XYPlane = agb.GetXYPlane(); agb.SetActivePlane (XYPlane ); var ps1 = planeXYSketchesOnly (new Object()); var rev1 = agb.Revolve(agc.add, ps1.Sketch1, ps1.XAxis, agc.DirNormal, 360.0, agc.No); agb.Regen(); |
|
December 9, 2015, 20:30 |
|
#2 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
two ways to do it.
1) Go to Create>Primitives>Sphere and generate it 2) create sketch you have created and choose "YZ" plane as axis when you revolve, so the last few lines of code will be like Code:
var ps1 = planeSketchesOnly1 (new Object()); agb.Regen(); var Rev1 = agb.Revolve(agc.Add, ps1.Sk1, ps1.XAxis, agc.DirNormal,360.0, 0.0, agc.No, 0.0, 0.0); agb.Regen(); Hope it helps Cheers KAPI |
|
December 11, 2015, 11:03 |
Thank you so much - another problem
|
#3 |
New Member
Aureliano Sancho
Join Date: May 2013
Location: Salvador-Ba-Brasil
Posts: 26
Rep Power: 13 |
Kapi,
Thank you so much, it helped a lot, but it appeared another problem. When I create a cylinder with ball in half and send cut the material, it does not. The agc.Cut command is not working. Can you help me? I want to stay that way 1.png but when I run the code looks like this 2.png -------------------------------------------------------------- agb.Regen (); //.................................................. .............. function planeXYSketchesOnly (p) { p.Plane = agb.GetActivePlane(); p.Origin = p.Plane.GetOrigin(); p.XAxis = p.Plane.GetXAxis(); p.YAxis = p.Plane.GetYAxis(); //.......................Primeiro Retangulo......................................... ... p.Sk1 = p.Plane.newSketch(); p.Sk1.Name = "Sk1"; with (p.Sk1) { p.Cr25 = Circle(0.0, 0.0, 4.0) } p.Sk2 = p.Plane.newSketch(); p.Sk2.Name = "Sk2"; with (p.Sk2) { p.Cr1 = ArcCtrEdge(0, 0, 2.0, 0, -2.0, 0); } p.Plane.EvalDimCons(); return p; } var XYPlane = agb.GetXYPlane(); agb.SetActivePlane (XYPlane ); var ps1 = planeXYSketchesOnly (new Object()); agb.Regen(); var ext1 = agb.Extrude(agc.Add, ps1.Sk1, agc.DirSymmetric, agc.ExtendFixed, 1.5, agc.ExtendFixed, 0.0, agc.No, 0.0, 0.0) agb.Regen(); var Rev1 = agb.Revolve(agc.Cut, ps1.Sk2, ps1.XAxis, agc.DirNormal,360.0, 0.0, agc.NO, 0.0, 0.0); agb.Regen(); |
|
December 13, 2015, 18:55 |
|
#4 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
just code it as you would do manually.
You can just suppress the body from parts and you will have the result. I strongly suggest you to do example from the help section so you will have answers to all these basic questions Cheers KAPI |
|
Tags |
abg.revolver, design modeler, scripting |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Workbench] Run ICEM Script in Workbench Script | MIZOR | ANSYS Meshing & Geometry | 9 | April 4, 2018 08:45 |
Grid Check Script | pdp.aero | SU2 | 2 | April 23, 2015 02:54 |
[ICEM] Problem with ICEM Script Meshing | asal | ANSYS Meshing & Geometry | 2 | March 23, 2013 20:11 |
CentFOAM Python Script Installation: Error | socon009 | OpenFOAM Installation | 2 | May 26, 2012 10:36 |
Perl script for intialisation | pratik mehta | CFX | 2 | September 10, 2008 04:09 |