Author Topic: GstarCAD API Error  (Read 1061 times)

0 Members and 1 Guest are viewing this topic.

neyton

  • Newt
  • Posts: 67
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: 67
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