如何得到选择集中块的名称
用下面的办法,不能得到对象的名字,特别是块的:For Each entry In ThisDrawing.ActiveSelectionSet<BR> entName = entry.ObjectName<BR> lObjectID = entry.ObjectID<BR> s = "Name:" & entName & ", ID:" & lObjectID & vbCrLf<BR> entry.Highlight (True)<BR> ThisDrawing.Application.Update<BR> MsgBox s<BR> entry.Highlight (False)<BR> Next<BR>那位高手指点一下 Sub gs()
Dim entry As AcadEntity
Dim entname As String
Dim lObjectID As Long
Dim s As String
Dim BlkName As String
For Each entry In ThisDrawing.ActiveSelectionSet
entname = entry.ObjectName
lObjectID = entry.ObjectID
BlkName = ""
If entname = "AcDbBlockReference" Then BlkName = " , BlockName:" & entry.Name
s = "Name:" & entname & ", ID:" & lObjectID & BlkName & vbCrLf
entry.Highlight (True)
ThisDrawing.Application.Update
MsgBox s
entry.Highlight (False)
Next
End Sub entname = "AcDbBlockReference"这里是否可以改成Ucase(entname) = "ACDBBLOCKREFERENCE"大小写转换起来太累,也容易出错 高手呀就是高手!佩服!!! 多谢大家,真是职业人呀,佩服,这么早就回了
页:
[1]