' Define name of Insert constraint we want to flip Dim InsertName As String = "InsertNew" ' Check that constraint has been renamed... If InsertName.Contains(":") Then MsgBox("You really ought to rename the constraint first - Exiting...", 64, "Cadline iLogic") Return End If Dim oDoc As AssemblyDocument Try oDoc = ThisApplication.ActiveEditDocument Catch MsgBox("This code must be run in an assembly file", 64, "Cadline iLogic") End Try Dim oInsert As InsertConstraint Try oInsert = oDoc.ComponentDefinition.Constraints.Item(InsertName) Catch MsgBox("A constraint called '" & InsertName & "' doesn't exist! - Exiting...", 64, "Cadline iLogic") Return End Try ' Get the two edges Dim oEdge1 As Edge = oInsert.EntityOne Dim oEdge2 As Edge = oInsert.EntityTwo ' Get whether constraint should be opposed Dim Opposed As Boolean = Not oInsert.AxesOpposed ' Delete the constraint oInsert.Delete ' Add it again the other way round Dim oNewInsert As InsertConstraint = oDoc.ComponentDefinition.Constraints.AddInsertConstraint(oEdge1, oEdge2, Opposed, 0) ' Rename it oNewInsert.Name = InsertName