PlaneFromPlane(basePlane)
PlaneFromPointEdge(point, edge)
PlaneFromPointNormal(point, item1, item2, item3)
: For this call, item2 and item3 are optional depending on how you define the Normal. It can be with an edge, two points, or three points (a cross product is used).PlaneFrom3Points(point1, point2, point3)
PlaneFromCoord(x, y, z, i, j, k)
Properties
Name
: Allows the feature to be named; for example, "CenterPlane".ReverseNormal
: Reverses/flips/inverts both the plane normal and X-axis.ReverseAxes
: Reverses/flips/inverts both the X- and Y-axis of the plane.ExportCS
: Exports the plane as a coordinate system into the Ansys Mechanical application.
Functions
AddTransform(type, value, edge)
: Adds a transform to the plane. The value and edge arguments are optional, but may be needed by the transform type you select. Note that for transform types XformEdgeRotate and XformXAlignEdge you should include both the value and edge arguments.GetOrigin()
: Returns the origin point of the plane.GetXAxis()
: Returns the X-axis line of the plane.GetYAxis()
: Returns the Y-axis line of the plane.EvalDimCons()
: Evaluates dimensions and constraints in a plane and modifies edges as needed.Sketch
Dimensions
Constraints
Example
var PF1 = agb.FPoint(agc.FPointConstruction, agc.FPointCoordinateFile); PF1.CoordinateFile = "E:\\Onyx90\\box8pt.txt"; agb.Regen(); //To insure model validity var LF1 = agb.LinePt(); LF1.AddSegment(PF1.GetPoint(1, 1), PF1.GetPoint(1, 2), 1); LF1.AddSegment(PF1.GetPoint(1, 2), PF1.GetPoint(1, 3), 2); agb.regen(); var Yes = agc.Yes; var No = agc.No; var plxy = agb.GetXYPlane(); var pl4 = agb.PlaneFromPlane(plxy); if(pl4) { pl4.Name = "Batch_Plane"; pl4.ReverseNormal = Yes; pl4.ReverseAxes = Yes; pl4.ExportCS = Yes; pl4.AddTransform(agc.XformZOffset, 9); pl4.AddTransform(agc.XformEdgeRotate, 30, LF1.GetEdge(1)); } agb.regen(); var spt1 = PF1.GetPoint(1, 3); var x,y,z; x = agb.GetPointX(spt1); y = agb.GetPointY(spt1); z = agb.GetPointZ(spt1); var pl5 = agb.PlaneFromCoord(x,y,z,1,2,3); if(pl5) { pl5.Name = "Batch_Coords"; pl5.ReverseNormal = No; pl5.ReverseAxes = No; pl5.ExportCS = Yes; } agb.regen(); spt0 = pl4.GetOrigin(); var spt2 = PF1.GetPoint(2, 2); var spt3 = PF1.GetPoint(2, 4); var pl6 = agb.PlaneFrom3Points(spt0, spt2, spt3); if(pl6) pl6.Name = "Batch_3_Pts"; agb.regen(); var pl7 = agb.PlaneFromPointEdge(spt2, LF1.GetEdge(1)); if(pl7) pl7.Name = "Batch_PT_Edge"; agb.regen(); var pl8 = agb.PlaneFromPointNormal(spt2, LF1.GetEdge(1)); if(pl8) pl8.Name = "Batch_PT_NORMAL_Edge"; agb.regen(); var pl9 = agb.PlaneFromPointNormal(spt2, PF1.GetPoint(1, 2), PF1.GetPoint(1, 3)); if(pl9) pl9.Name = "Batch_PT_Normal_2Pts"; agb.regen(); var pl10 = agb.PlaneFromPointNormal(spt2, PF1.GetPoint(1, 2), PF1.GetPoint(1, 3), PF1.GetPoint(1, 4)); if(pl10) pl10.Name = "Batch_PT_Normal_3Pts"; agb.regen(); //Now to use one of the planes to create a small sketch agb.SetActivePlane(p15); agb.AutoConstraintGlobal(agc.Yes); var q = plane15Sketch (new Object()); agb.Regen(); function plane15Sketch (p) { //Plane p.Plane = agb.GetActivePlane(); //Sketch p.Sk1 = p.Plane.newSketch(); p.Sk1.Name = "SketchOnP15"; //Edges with (p.Sk1) { p.Ln15_1 = Line(10, 10, 30, 10); p.Ln15_2 = Line(30, 10, 30, 20); p.Ln15_3 = Line(30, 20, 10, 20); p.Ln15_4 = Line(10, 20, 10, 10); } p.Plane.EvalDimCons(); }