object invoked?

Discussion in 'AutoCAD' started by john m, Sep 19, 2004.

  1. john m

    john m Guest

    ThisDrawing.ModelSpace.InsertBlock InsertionPoint, BlockName, 1, 1, 1, 0

    when i try this i get the error "The object invoked has disconnected from
    its clients."

    the block name is the path to a drawing on the network.

    the insertion point is a variant i set with utility getpoint

    Can anyone give me an idea whats happening here?

    thanks in advance for any assistance...

    jm
     
    john m, Sep 19, 2004
    #1
  2. The calee application has lost connection with AutoCAD somehow. Check the
    ThisDrawing variable for it's contents.

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Sep 19, 2004
    #2
  3. john m

    john m Guest

    this very simple program is crashing now....
    the JIT debugging program is telling me the class isn't registered..
    what class?
    i checked that the thisdrawing variable is correct just prior to the insert

    is all this new with 2005?
     
    john m, Sep 20, 2004
    #3
  4. What are you writing this in? You make references to .NET which, if that's
    what you're using, you CAN'T use ThisDrawing! You have to capture the
    active document yourself - just as if it were VB6. ThisDrawing ONLY works
    in VBA [unless you choose to name your doc object the same].

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 20, 2004
    #4
  5. john m

    john m Guest

    thanks mike.
    i do have dot net installed and have been experimenting with it, but in this
    instance am just using VBA.
     
    john m, Sep 20, 2004
    #5
  6. hmmm... can you post code John?

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 20, 2004
    #6
  7. john m

    john m Guest

    i tried to simplify the program to post it and now i get a different error.
    now it says "key not found."
    at least it no longer locks up autocad every time.
    I'm just trying to insert a block here... is this something new?

    the help engine explains that "key not found." means the key was not found.

    what key?
     
    john m, Sep 22, 2004
    #7
  8. Out of curiosity, do you have Require Variable Declaration set in the
    VBAIDE? If not, add it so it auto places Option Explicit at the beginning
    of each module and then try running your program. It'll help flush out the
    real problem.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 22, 2004
    #8
  9. john m

    john m Guest

    yes object explicit is set
    still says key not found

    Private Sub cmdPutOnDrawing_Click()

    Dim InsertionPoint As Variant
    Dim BlockName As String
    Me.hide
    InsertionPoint = ThisDrawing.Utility.GetPoint(, "Pick Insertion Point
    for Schematic")
    BlockName =
    "s:/acad/hvac/schematc/drawings/fueloil/twoabovepumpskid.dwg"

    ThisDrawing.ModelSpace.InsertBlock InsertionPoint, BlockName, 1, 1, 1, 0

    End Sub
     
    john m, Sep 22, 2004
    #9
  10. Try backslashes in that filename. ;^)

    --
    R. Robert Bell


    yes object explicit is set
    still says key not found

    Private Sub cmdPutOnDrawing_Click()

    Dim InsertionPoint As Variant
    Dim BlockName As String
    Me.hide
    InsertionPoint = ThisDrawing.Utility.GetPoint(, "Pick Insertion Point
    for Schematic")
    BlockName =
    "s:/acad/hvac/schematc/drawings/fueloil/twoabovepumpskid.dwg"

    ThisDrawing.ModelSpace.InsertBlock InsertionPoint, BlockName, 1, 1, 1, 0

    End Sub
     
    R. Robert Bell, Sep 23, 2004
    #10
  11. john m

    john m Guest

    aiyiyi

    thanks all

    jm
     
    john m, Sep 23, 2004
    #11
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.