Click or drag to resize

IManagedConstraints Interface

Provides functions to add, modify, and delete assembly constraints.

In a rule, this interface is implemented by the predefined object named Constraints (which is the same object as ThisAssembly.Contraints).

Namespace:  Autodesk.iLogic.Interfaces
Assembly:  Autodesk.iLogic.Interfaces (in Autodesk.iLogic.Interfaces.dll) Version: 23.0
Syntax
Public Interface IManagedConstraints

The IManagedConstraints type exposes the following members.

Methods
  NameDescription
Public methodAddAngle
Adds or modifies an angle assembly constraint.
Public methodAddByiMateAndEntity
Adds or modifies a constraint between an iMate and an entity.
Public methodAddByiMates
Adds or modifies a constraint between iMates.
Public methodAddFlush
Adds or modifies a flush assembly constraint.
Public methodAddInsert
Adds or modifies an insert assembly constraint.
Public methodAddMate
Adds or modifies a mate assembly constraint.
Public methodAddRotate
Adds or modifies a rotate-rotate or rotate-translate assembly constraint.
Public methodAddSymmetry
Adds or modifies a symmetry assembly constraint.
Public methodAddTangent
Adds or modifies a tangent assembly constraint.
Public methodAddTransitional
Adds or modifies a transitional assembly constraint.
Public methodAddUcsToUcs
Adds or modifies a constraint set. This consists of three flush constraints between two items that are either User Coordinate Systems (UCS's), component origins, or the assembly origin.
Public methodDelete
Deletes an assembly constraint. There is no error if the constraint does not exist (maybe because it was already deleted).
Top
Remarks
Constraints can be managed using BeginManage(String) and EndManage(String).

The Add* functions use entity names to identify the elements to be constrained. Unless iMates are being used, these are either:

  • Face, edge, or vertex names
  • Work feature names
Face, edge, and vertex names can be assigned in Inventor with right-click context menu commands.

If you use work features or iMates, it's best to rename them. If you keep the default names, your rules may not work on a system that is using a different language pack.

The Add* functions have ComponentArgument arguments to specify the components that contain the entity to be constrained. See that topic for more details. An empty string (or Nothing) can be used for the ComponentArgument to refer to an entity (e.g. a workplane) that is not in any component but is instead in the assembly itself.

If a constraint name is specified, a constraint with that name will be created if it doesn't exist. If it does exist, the system will ensure that it meets the all the specifications in the current function call. If it already meets the specification, then no change is required. If it doesn't meet the specification, it will be modified so that it does. To do that, the system might have to delete the existing constraint and create a new one.

Many of the methods have optional biasPoint arguments. These are passed to the underlying Inventor API methods (AssemblyConstraints.AddMateConstraint etc.) with no conversion. They can be of type Inventor.Point.

See Also