entityName AND OBJECTName

Discussion in 'AutoCAD' started by youngman, Aug 25, 2004.

  1. youngman

    youngman Guest

    HI,

    what is the difference between entityName AND OBJECTName.

    why i cannot find entityName in Developer Help.

    IT RUNS WELL.

    TAHNK YOU

    REGARDS
     
    youngman, Aug 25, 2004
    #1
  2. youngman

    bcoward Guest

    Youngun,

    EntityName specifies the name of an entity.

    The entity name is equivalent to the class name of the object. When querying AutoCAD objects, use the EntityType property. When querying custom objects, if no EntityType has been provided, you can use this property to identify the entity.

    Hope this helps.

    Good luck,

    Bob Coward
    CADS, Inc

    800-366-0946
     
    bcoward, Aug 25, 2004
    #2
  3. EntityType = Returns the entity type of the object as an integer.
    EntityName = Returns the class name of the object.
    ObjectName = Gets the AutoCAD class name of the object.
    As EntityType & EntityName are hidden members I would avoid them.
    Also see the posts by Bobby C. Jones & Tony Tanzillo in this thead http://discussion.autodesk.com/thread.jspa?messageID=387042 for info on the use of the TypeOf clause.

    Regards - Nathan
     
    Nathan Taylor, Aug 26, 2004
    #3
  4. youngman

    youngman Guest

    Thanks for your replies.

    1.in autocad developer help there are, for instance "VBA object name:
    AcadDim3PointAngular " ,why sometimes they are different from entityname ,
    where can i get a list ,about them.

    2.when I make a angular dimention,and the objectname is called
    ,AcDb2LineAngularDimension.

    i wouldlike to know what the VBA object name of the object is .

    thank you




    http://discussion.autodesk.com/thread.jspa?messageID=387042 for info on the
    use of the TypeOf clause.
     
    youngman, Aug 26, 2004
    #4
  5. I use the TypeOf clause that way intellisence allows me to chose the type of object. As I finish typeing 'Is' in the following example I get a list of objects to choose.
    **EXAMPLE**
    For Each objEnt In objsset
    If TypeOf objEnt Is AcadText Then

    ElseIf TypeOf objEnt Is AcadLWPolyline Then

    ElseIf TypeOf objEnt Is AcadPoint Then

    End If
    Next objEnt
    **END EXAMPLE**

    Regards - Nathan
     
    Nathan Taylor, Aug 26, 2004
    #5
  6. youngman

    youngman Guest

    thanks,

    but the AcadLine 's typename is IAcadLine ,WHY.

    THANKS A LOT.





    of object. As I finish typeing 'Is' in the following example I get a list of
    objects to choose.
     
    youngman, Aug 26, 2004
    #6
  7. youngman

    youngman Guest

    may i ask one more question ,how to get the all property one time.

    (i want to put them all in a listbox.)
    thank you
     
    youngman, Aug 26, 2004
    #7
  8. youngman

    MP Guest

    I may say this wrong but I understood from a recent post by Tony Tanzillo -
    to whom is due my eternal gratitude for all his sharing and teaching here -
    that the typename IAcadLine (stands for Interface) is the base Interface -
    the properties / methods which are exposed by that interface. The AcadLine
    is a class which implements that Interface. Other classes(custom classes)
    could also implement that interface in its' own unique way.
    not sure the dif between AcDbAcadLine and AcadLine
    IAcadLine - Interface name
    AcDbAcadLine - Class name?
    AcadLine - Class name?

    no way I know to 'iterate' the properties
    you have to learn them from the docs/intellisense/objectbrowser/study etc
    then you can populate your listbox with whichever ones you want to.

    in addition to Nathans if else if approach you can use a select case
    I don't know if there is anything wrong with using select case True or not
    but it works
    Sub test()
    Dim oent As AcadEntity, vp As Variant, srpt As String

    ThisDrawing.Utility.GetEntity oent, vp, "pick"
    srpt = "Typename: " & TypeName(oent) & vbCrLf & _
    "Objectname: " & oent.ObjectName

    Select Case True
    Case Is = TypeOf oent Is Acad3DSolid
    srpt = srpt & vbCrLf & "TypeOf: Acad3DSolid"
    Case Is = TypeOf oent Is AcadLine
    srpt = srpt & vbCrLf & "TypeOf: AcadLine"
    Case Is = TypeOf oent Is AcadCircle
    srpt = srpt & vbCrLf & "TypeOf: AcadCircle"
    Case Is = TypeOf oent Is AcadLWPolyline
    srpt = srpt & vbCrLf & "TypeOf: AcadLWPolyline"
    Case Else
    srpt = srpt & vbCrLf & "TypeOf: other"
    End Select

    MsgBox srpt
    End Sub
     
    MP, Aug 26, 2004
    #8
  9. Don't know if it's available in VBA, but in VB I use the TypeLib Information
    (TLBinf32.dll)

    Dim TLInf As TypeLibInfo
    Set TLInf = TypeLibInfoFromFile("complete path and name of your tlb file
    here")
     
    Jorge Jimenez, Aug 26, 2004
    #9
  10. Thanks Jorge, there has been a few time that would have been very handy for me.
    Regards - Nathan
     
    Nathan Taylor, Aug 26, 2004
    #10
  11. Hi Jorge,

    Have you got any examples you can share? I can use the GetMembersDirect method to fill a dialog with the members of a specific member. What I can not work out is whether a member is a Property or Method or whether a member is readonly.

    Regards - Nathan
     
    Nathan Taylor, Sep 8, 2004
    #11
  12. Better yet, this is the link where you can download the complete help file
    including code samples.

    http://support.microsoft.com/?kbid=224331


    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


    method to fill a dialog with the members of a specific member. What I can
    not work out is whether a member is a Property or Method or whether a member
    is readonly.
     
    Jorge Jimenez, Sep 8, 2004
    #12
  13. Thanks Jorge, I had found that and have been using it but don't find it the best help. I will keep looking at it and should find what I am looking for soon enough.
    Regards - Nathan
     
    Nathan Taylor, Sep 8, 2004
    #13
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.