Untitled diff
19 lines
Option Explicit on
Dim oAsmCompDef As AssemblyComponentDefinition
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim comp0cc1 As ComponentOccurrence = Component.InventorComponent("Component_#1")
Dim comp0cc1 As ComponentOccurrence = Component.InventorComponent("Component_#1")
Dim comp0cc2 As ComponentOccurrence = Component.InventorComponent("Component_#2")
Dim comp0cc2 As ComponentOccurrence = Component.InventorComponent("Component_#2")
Dim oPlane1 As WorkPlane
Dim oPlane1 As WorkPlane
oPlane1 = comp0cc1.Definition.WorkPlanes("Work Plane #1")
oPlane1 = comp0cc1.Definition.WorkPlanes("Work Plane #1")
Dim oPlane2 As WorkPlane
Dim oPlane2 As WorkPlane
oPlane2 = comp0cc2.Definition.WorkPlanes("Work Plane #2")
oPlane2 = comp0cc2.Definition.WorkPlanes("Work Plane #2")
Dim oproxyPlane1 As WorkPlaneProxy
Dim oproxyPlane1 As WorkPlaneProxy
comp0cc1.CreateGeometryProxy(oPlane1, oproxyPlane1)
comp0cc1.CreateGeometryProxy(oPlane1, oproxyPlane1)
Dim oproxyPlane2 As WorkPlaneProxy
Dim oproxyPlane2 As WorkPlaneProxy
comp0cc2.CreateGeometryProxy(oPlane2, oproxyPlane2)
comp0cc2.CreateGeometryProxy(oPlane2, oproxyPlane2)
Dim oConstraint As MateConstraint
Dim oConstraint As MateConstraint
oConstraint = oAsmCompDef.Constraints.AddMateConstraint(oproxyPlane1, oproxyPlane2,0)
oConstraint = oAsmCompDef.Constraints.AddMateConstraint(oproxyPlane1, oproxyPlane2,0)
oConstraint.Name = comp0cc1.Name & ":" & comp0cc2.Name & " mate"
oConstraint.Name = comp0cc1.Name & ":" & comp0cc2.Name & " mate"