typename(object)返回什么STRING?
Sub GetEntity2()Dim retEnt As Object
Dim pnt As Variant
On Error Resume Next
' The following example waits for a input from user and returns the Line in retEnt
ThisDrawing.Utility.GetEntity retEnt, pnt, "Select an object"
If Err0 Then
Err.Clear
MsgBox "You need to select an existing object"
Else
Select Case LCase(TypeName(retEnt)) //该怎么写?
Case "acdbcircle" //返回什么串才对?
MsgBox "Circle"
Case "acdbline" //返回什么串才对?
MsgBox "Line"
Case Else
MsgBox "others"
End Select
end if
end sub LCase(TypeName(retEnt))改为:
retEnt.EntityName
acdbcircle改为AcDbCircle,余同。
页:
[1]