I'd like to load a dwg file in my application with Cad Import Net.dll.
The dwg file format is AC2013, saved by Autocad 2014.
Cad Import Net.dll. version is 9.0.0.30903.
But, I can't load.
The response of my application doesn't return, processing stalls in the following code:
So, the following code is the same of ViewerDemo of the package.
Is there any library to load a AC2013 dwg?
Could you help me!
Code: Select all
Public Sub LoadFile(ByVal fileName As String)
If (Not fileName Is Nothing) Then
If (Not Me.cadImageFld Is Nothing) Then
Me.cadImageFld.Dispose()
Me.cadImageFld = Nothing
Me.lForm.LayerList.Clear()
RemoveHandler Me.lForm.LayerList.SelectItemEvent, Me.listItemSelectDel
End If
Me.Cursor = Cursors.WaitCursor
Me.stBar.Panels.Item(0).Text = ApplicationConstants.loadfilestr
Me.ImageScale = 1.0!
Me.ImagePreviousScale = 1.0!
Me.Position = New PointF
Try
Me.cadImageFld = CADImage.CreateImageByExtension(fileName)
Catch ex As Exception
MessageBox.Show(String.Format("[{0}] {1}", ex.Message, ex.StackTrace), ApplicationConstants.msgBoxDebugCaption, MessageBoxButtons.OK)
End Try
If TypeOf Me.cadImageFld Is CADRasterImage Then
CType(Me.cadImageFld, CADRasterImage).Control = Me.cadPictBox
End If
End If
If (Not Me.cadImageFld Is Nothing) Then
Try
CADConst.SHXSearchPaths += Me.shxFrm.SHXPaths
Me.cadImageFld.SHXSearchPaths = Me.shxFrm.SHXPaths
If CADConst.IsWebPath(fileName) Then
Me.cadImageFld.LoadFromWeb(fileName)
Else
*error code Me.cadImageFld.LoadFromFile(fileName)
End If
Catch ex As Exception
MessageBox.Show(String.Format("[{0}] {1}", ex.Message, ex.StackTrace), ApplicationConstants.msgBoxDebugCaption, MessageBoxButtons.OK)
End Try
End If
Me.stBar.Panels.Item(0).Text = (Path.GetFileName(fileName) & ApplicationConstants.sepstr)
cadImage.LastLoadedFilePath = Path.GetDirectoryName(fileName)
Me.SetCADImageOptions()
End Sub]
Yoshitoki
Code: Select all