.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ReadDWGFile vs. molasses in december

0 REPLIES 0
Reply
Message 1 of 1
James1.0
190 Views, 0 Replies

ReadDWGFile vs. molasses in december

Hello All,
This is my first post!!1@ The .NET Discussion group has been really helpful in the past. Thanks in advance for posting

Is there a faster way to read dwg files into a drawing than using db.ReadDWGFile. Each read is running about .5 seconds. This is okay if the number of reads is slim but for large amounts of reads this will feel like molasses in december. Any suggestions on how to speed the read process up?

Here's the code im running

Dim fname As String = ServerPath + DWG_Array(ID_Index) + ".DWG"

HostApplicationServices.Current.FindFile(fname, doc.Database, FindFileHint.Default)
Dim db1 As Database = New Database(False, False)

''this takes .5second to read the file
db1.ReadDwgFile(fname, System.IO.FileShare.Read, True, Nothing)

Dim idBTR As ObjectId = doc.Database.Insert(DWG_Array(ID_Index), db1, False)
Dim origin As Point3d = New Point3d(xOrigin + _BLOCK_X_OFFSET * _Xscale, yOrigin, 0)
Dim bref As BlockReference = New BlockReference(origin, idBTR)
Dim BlockScale As Scale3d = New Scale3d(_Xscale, _yScale, 1)

bref.ScaleFactors = BlockScale
bref.TransformBy(ED.CurrentUserCoordinateSystem)
btr.AppendEntity(bref)
trans.TransactionManager.AddNewlyCreatedDBObject(bref, True)
CType(db1, IDisposable).Dispose()
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost