Author Topic: GstarCAD API Error  (Read 2320 times)

0 Members and 1 Guest are viewing this topic.

neyton

  • Newt
  • Posts: 68
GstarCAD API Error
« on: November 04, 2015, 09:24:13 AM »
Has anyone tried to open a DWG file using the API of  GstarCAD?
See the code below.
It gives error "eNotThatKindOfClass" (error code 63)

Code: [Select]
<CommandMethod("teste")>
    Public Sub teste()

        Dim f As New OpenFileDialog
        If Not f.ShowDialog Then Exit Sub


        Dim dbt As New Database(False, True)


        dbt.ReadDwgFile(f.FileName, FileOpenMode.OpenForReadAndReadShare, False, Nothing)



    End Sub
Visit my website: http://tbn2.blogspot.com

neyton

  • Newt
  • Posts: 68
Re: GstarCAD API Error
« Reply #1 on: November 10, 2015, 10:01:35 AM »
Hi,

Changes:

 dbt.ReadDwgFile(f.FileName, FileOpenMode.OpenForReadAndReadShare, False, Nothing)

to

 dbt.ReadDwgFile(f.FileName, FileShare.Read, True, "")

works!!!
Visit my website: http://tbn2.blogspot.com