GetEntity Automation problem

Discussion in 'AutoCAD' started by Chris Kelly, Oct 14, 2004.

  1. Chris Kelly

    Chris Kelly Guest

    Hello again,
    I've searched and searched and searched but to no avail. I have a
    dialog box with a button labelled 'pick entity'. When clicked, the
    dialog is hidden (with Me.hide) and I call the function, then I call
    Me.show

    Thisdrawing.Utility.GetEntity obj, var, "Pick entity"
    where obj is an AutoCAD object and var is a variant
    I've tried using AcadEntity(s) and AcadPoint(s) and every mixture but
    it makes no difference. When I call the function there is always an
    automation error. Is it possible to use VBA dialogs interactively? I
    can get it working no problem if I call the code without clicking the
    button. Has anyone come across this problem before. Many thanks if
    anyone can help me on this. Here is the code I am using:

    Function entsel() As Object
    On Error GoTo entsel_error
    Dim obj As Object
    Dim pt(0 To 2) As Double
    ThisDrawing.Utility.GetEntity obj, pt, "Select Block From screen"
    entsel = obj
    entsel_error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
    procedure entsel of Module LayerMod"
    End Function
     
    Chris Kelly, Oct 14, 2004
    #1
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.