快速找出2个type中的不同属性
Type block blockName As String handel As StringEnd TypeType line lineName As String handel As StringEnd TypeSub yjjc() Dim ent As AcadEntity Dim arrblock() As block ReDim arrblock(3000) Dim arrline() As line ReDim arrline(3000) Dim cntb As Long cntb = 0 Dim cntl As Long cntl = 0 For Each ent In ThisDrawing.ModelSpace Select Case ent.ObjectName Case "AcDbBlockReference" arrblock(cntb).blockName = getXdataByText(ent, "点号") arrblock(cntb).handel = ent.handle cntb = cntb + 1 If cntb = 3000 Then ReDim Preserve arrblock(10000) End If Case "AcDbPolyline" arrline(cntl).lineName = getXdataByTextForLine(ent, "点号") arrline(cntl).handel = ent.handle cntl = cntl + 1 If cntl = 3000 Then ReDim Preserve arrline(10000) End If End Select NextEnd Sub