将选择集中不不是当前空间中的对象去除

来源:互联网 发布:淘宝能更改实名认证吗 编辑:程序博客网 时间:2024/04/29 12:40
'*************将选择集中不不是当前空间中的对象去除********************
    Public Sub FilterLayout(ByRef ss As ZcadSelectionSet, ByRef layoutName As String)
        Dim max As Integer
        Dim objArray() As ZcadEntity
        max = -1
        Dim i As Short
        For i = 0 To ss.Count - 1
            If LCase(ThisDrawing.ObjectIdToObject(ss.Item(i).OwnerID).Layout.Name) <> LCase(layoutName) Then
                max = max + 1
                ReDim Preserve objArray(max)
                objArray(max) = ss.Item(i)
            End If
        Next
        ss.RemoveItems(objArray)
    End Sub
原创粉丝点击