'对象居中
'天正建筑中的窗居墙体中间
' 在此操作之前应该将窗编号隐藏
Sub Center_E2E_Center1()
Dim P As Variant
Dim E As AcadEntity
Dim SSet As AcadSelectionSet
Dim I As Long
Dim PC1 As Variant, PC2 As Variant
Dim Wall As AcadEntity
On Error GoTo xErr
xNext:
ThisDrawing.Utility.GetEntity E, P, "第一个窗对象:"
PC1 = GetCenter(E)
Set SSet = GetE_SideByE(E)
For I = 0 To SSet.Count - 1
'Prompt SSet.item(I).ObjectName & vbCrLf
If SSet.item(I).ObjectName = "TDbWall" Then
Set Wall = SSet.item(I)
PC2 = GetCenter(Wall)
E.Move PC1, PC2
End If
Next I
xErr:
End Sub
'天正建筑中的窗居墙体中间
' 在此操作之前应该将窗编号隐藏
Sub Center_E2E_Center1()
Dim P As Variant
Dim E As AcadEntity
Dim SSet As AcadSelectionSet
Dim I As Long
Dim PC1 As Variant, PC2 As Variant
Dim Wall As AcadEntity
On Error GoTo xErr
xNext:
ThisDrawing.Utility.GetEntity E, P, "第一个窗对象:"
PC1 = GetCenter(E)
Set SSet = GetE_SideByE(E)
For I = 0 To SSet.Count - 1
'Prompt SSet.item(I).ObjectName & vbCrLf
If SSet.item(I).ObjectName = "TDbWall" Then
Set Wall = SSet.item(I)
PC2 = GetCenter(Wall)
E.Move PC1, PC2
End If
Next I
xErr:
End Sub
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |