ObjectDBX .NET

Discussion in 'AutoCAD' started by HJohn, Jun 29, 2004.

  1. HJohn

    HJohn Guest

    Can someone tell me how to create an AXDBLib.AxDbDocument object in .NET. I am using this, Dim DbxDoc As New AXDBLib.AxDbDocument, but it returns a error. Thanks in advance.
     
    HJohn, Jun 29, 2004
    #1
  2. HJohn

    HJohn Guest

    Never mind, I found my mistake. Thanks anyway for reading it.
     
    HJohn, Jun 29, 2004
    #2
  3. You might consider sharing the mistake and your solution. It could prove
    useful to the next person.
     
    Frank Oquendo, Jun 29, 2004
    #3
  4. HJohn

    SpeedCAD Guest

    Do you can post here?
     
    SpeedCAD, Jun 29, 2004
    #4
  5. HJohn

    HJohn Guest

    I was trying to create the DbxDoc before the AcadApp object, so there was not an acad application to start the DbxDoc. However, now I having problems quitting the AcadApp. I can open the test drawing tru ObjectDBX and interact with it. When finish with it, it set the DbxDoc = nothing and then try AcadApp.quit() and finally AcadApp=nothing. I am getting a fatal error from AutoCAD when the AcadApp.quit() method is executed. Any ideas?
     
    HJohn, Jun 29, 2004
    #5
  6. You must explicitly release COM objects using the following line of
    code:

    System.Runtime.InteropServices.Marshal.ReleaseComObject(<object>)

    Both the AxDbDocument and the AcadApplication object are COM objects.
    Also, be sure to release any child objects before the parent. So the
    AxDbDcoument gets released before the AcadApplication.
     
    Frank Oquendo, Jun 29, 2004
    #6
  7. HJohn

    HJohn Guest

    Frank, Thanks
    That was it. After releasing the DbxDoc I was able to Quit Autocad, release it and set its object reference to nothing.
     
    HJohn, Jun 29, 2004
    #7
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.