New Member
1 Posts
0 Kudos
Registered: ‎09-22-2006
Post 1 of 1

ReadDWGFile vs. molasses in december

73 Views, 0 Replies
09-22-2006 12:39 PM
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
trans.TransactionManager.AddNewlyCreatedDBObject(bref, True)
CType(db1, IDisposable).Dispose()
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post