Sub Center_E2E_Center()
Dim P As Variant
Dim P1 As Variant, P2 As Variant
Dim E1 As AcadEntity
Dim E2 As AcadEntity
On Error GoTo xErr
xNext:
ThisDrawing.Utility.GetEntity E1, P, "第一个对象:"
P1 = GetCenter(E1)
E1.Visible = False
ThisDrawing.Utility.GetEntity E2, P, "第二个对象:"
P2 = GetCenter(E2)
E1.Move P1, P2
E1.Visible = True
GoTo xNext
xErr:
End Sub
Dim P As Variant
Dim P1 As Variant, P2 As Variant
Dim E1 As AcadEntity
Dim E2 As AcadEntity
On Error GoTo xErr
xNext:
ThisDrawing.Utility.GetEntity E1, P, "第一个对象:"
P1 = GetCenter(E1)
E1.Visible = False
ThisDrawing.Utility.GetEntity E2, P, "第二个对象:"
P2 = GetCenter(E2)
E1.Move P1, P2
E1.Visible = True
GoTo xNext
xErr:
End Sub
阅读全文……