lei_jinbo 发表于 2003-8-27 16:49:00

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

thankyou 发表于 2003-8-27 17:25:00

LCase(TypeName(retEnt))改为:
retEnt.EntityName
acdbcircle改为AcDbCircle,余同。
页: [1]
查看完整版本: typename(object)返回什么STRING?