CAD/CAM discussion forum > CAD > Import DXF with VB.NET

Import DXF with VB.NET

    
  Subscribe Topic

Rank: 2

siggisal9294

Assistant Engineer

posts: 19

Registered: 2016-9-13

Message 1 of 8

 Import DXF with VB.NET
24-09-2016 05:15 . am   |   View his/her posts only
Hi

I use this code to import dxf file this works
but the progressbar go to 96% and when I am finish to import last file the Progressbar stay in 96%


_
Public Sub importadxf()
ins1("PATG TO DXF FILE1.dxf", "PATG TO LOG FILE1.log")
ins1("PATG TO DXF FILE2.dxf", "PATG TO LOG FILE2.log")
End Sub

Public Sub insert(ByVal dxf_file, ByRef log_file)

Dim ZWDoc As Document = ZwSoft.ZwCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim ZWDb As Database = ZWDoc.Database
Dim ZWEd As Editor = ZWDoc.Editor


Dim dxf_file_import As [String] = dxf_file
Dim log_file_import As [String] = log_file

Using myTrans As Transaction = ZWDb.TransactionManager.StartTransaction()
Dim dxf_file_database As New Database(False, True)
dxf_file_database.DxfIn(log_file_import, dxf_file_import)
Dim dxfTrf As Matrix3d = Matrix3d.Identity
ZWDb.Insert(dxfTrf, dxf_file_database, True)

ZWDb.UpdateExt(True)
Dim ZWTable As New ViewTableRecord()
Dim minPoint As Point3d = ZWDb.Extmin
Dim maxPoint As Point3d = ZWDb.Extmax
Dim vMax As New Point2d(maxPoint.X, maxPoint.Y)
Dim vMin As New Point2d(minPoint.X, minPoint.Y)
ZWTable.CenterPoint = vMin + 0.5 * (vMax - vMin)
ZWTable.Height = vMax.Y - vMin.Y
ZWTable.Width = vMax.X - vMin.X
ZWDoc.Editor.SetCurrentView(ZWTable)
myTrans.Commit()
ZWDb.Dispose()

End Using

End Sub

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 496

Registered: 2015-6-9

Message 2 of 8

27-09-2016 05:43 . pm   |   View his/her posts only
Reply 1# siggisal9294


Hi,
Which product and version are you using? Please command VERNUM to check.

Rank: 2

siggisal9294

Assistant Engineer

posts: 19

Registered: 2016-9-13

Message 3 of 8

28-09-2016 12:43 . am   |   View his/her posts only
version = 2016.08.26(8293)_x64

Rank: 2

siggisal9294

Assistant Engineer

posts: 19

Registered: 2016-9-13

Message 4 of 8

28-09-2016 02:39 . am   |   View his/her posts only
ZWCAD 2017 version = 2016.08.26(8293)_x64

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 496

Registered: 2015-6-9

Message 5 of 8

30-09-2016 05:06 . pm   |   View his/her posts only
Reply 4# siggisal9294


OK, thanks. We will check ASAP.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 496

Registered: 2015-6-9

Message 6 of 8

30-11-2016 04:22 . pm   |   View his/her posts only
Reply 1# siggisal9294


Hi, ZWCAD 2017 has updated to SP1.2, is this issue solved yet?

Rank: 2

siggisal9294

Assistant Engineer

posts: 19

Registered: 2016-9-13

Message 7 of 8

24-12-2016 09:08 . am   |   View his/her posts only
dxf-progressbar.png
2016-12-24 09:07

Finish to upgrade to SP1.3
Progressbar go to 100% the Progressbar does not disappear when it is finish it stay on

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 496

Registered: 2015-6-9

Message 8 of 8

06-01-2017 03:08 . pm   |   View his/her posts only
Reply 7# siggisal9294


Hi, When it reaches to 100%, does the dxf file successfully imported even with the 100% process bar still remains there?
See also
X