Constraints

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 on

  • agb.AutoConstraintGlobal(agc.No); //Turns auto constraints off

Constraint Creation Functions (these are Plane functions)
  • FixedCon(edge, endSwitch): Creates a Fixed constraint

    endSwitch is non-zero if it should be applied to the endpoints as well
  • HorizontalCon(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 coincident
  • CoincidentConLock(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 tangent
  • ConcentricCon(edge1, edge2): Creates a Concentric constraint for points, arcs, circles, ellipses, or elliptic arcs

  • MidpointCon(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 circles

  • EqualLengthCon(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 constraint

    axis must be a line
    edge1 and edge2 must be of the same type, and neither can be a spline
    endSwitch is non-zero if it should be applied to the endpoints as well