Once you have edges, you can constrain them. Note that by default AutoConstraints:Global is turned off while running a script. This can be controlled using the AutoConstraintGlobal command:
agb.AutoConstraintGlobal(agc.Yes);
//Turns auto constraints onagb.AutoConstraintGlobal(agc.No);
//Turns auto constraints off
Constraint Creation Functions (these are Plane functions)
FixedCon(edge, endSwitch)
: Creates a Fixed constraintendSwitch
is non-zero if it should be applied to the endpoints as wellHorizontalCon(edge
): Creates a Horizontal constraint for a line or an ellipse (major axis)VerticalalCon(edge)
: Creates a Vertical constraint for a line or an ellipse (major axis)ParallelCon(edge1, edge2
): Creates a Parallel constraint for lines or ellipses (major axis)PerpendicularCon(edge1, selx1, sely1, edge2, selx2, sely2)
: Creates a Perpendicular constraint‘sel’
locations should be near area on edges where their tangents will be at a 90° angle. These values are not important for lines.CoincidentCon(edge1, selx1, sely1, edge2, selx2, sely2)
: Creates a Coincident constraint‘sel’
locations should be near area on edges where they are to be coincidentCoincidentConLock(edge1, selx1, sely1, edge2, selx2, sely2, fixParam)
: Creates a "Locked" Coincident constraint.‘sel’
locations should be near area on edges where they are to be coincident‘fixParam’
should be 1 to lock at the nearest parameter on first curve; 2 to lock on second curve. This is normally only used by the fit points on splines.TangentCon(edge1, selx1, sely1, edge2, selx2, sely2)
: Creates a Tangent constraint‘sel’
locations should be near area on edges where they are to be tangentConcentricCon(edge1, edge2)
: Creates a Concentric constraint for points, arcs, circles, ellipses, or elliptic arcsMidpointCon(edge1, edge2)
: Creates a Midpoint constraint. One edge must be a line and the other a point.EqualRadiusCon(edge1, edge2)
: Creates an Equal Radius constraint for arcs or circlesEqualLengthCon(edge1, edge2)
: Creates an Equal Length constraint for lines. This is actually the same as an Equal Distance constraint using the endpoints of the lines.EqualDistanceCon(edge1, edge2, edge3, edge4)
: Creates an Equal Distance constraint. Only points and lines are allowed. The distance between the first two edges will be the same as between the last two edges.SymmetryCon(edge1, edge2, axis, endSwitch)
: Creates a Symmetry constraintaxis
must be a lineedge1
andedge2
must be of the same type, and neither can be a splineendSwitch
is non-zero if it should be applied to the endpoints as well