With the arguments BiasPointOne and BiasPointTwo in AddMateConstraint , the occurrences should be repositioned to make the two bias points coincident. The BiasPoint used by method AddMateConstraint should be from model space. So you need to use the native object of the point to add this constraint. The code below assumes that two faces and two vetex of different occurrences in an assembly context are selected.
Sub constraintWithBiasPoints() ' assume we have had the inventor application Dim oDoc As Document oDoc = _InvApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oDoc.ComponentDefinition Dim oFaceProxy1 As FaceProxy Dim oFaceProxy2 As FaceProxy Dim oPointProxy1 As VertexProxy Dim oPointProxy2 As VertexProxy oFaceProxy1 = oDoc.SelectSet(1) oFaceProxy2 = oDoc.SelectSet(2) oPointProxy1 = oDoc.SelectSet(3) oPointProxy2 = oDoc.SelectSet(4) oDef.Constraints.AddMateConstraint(oFaceProxy1, _ oFaceProxy2, _ 0, _ InferredTypeEnum.kNoInference, _ InferredTypeEnum.kNoInference, _ oPointProxy1.NativeObject.Point, _ oPointProxy2.NativeObject.Point) End Sub

Leave a Reply