Message 1 of 8
Not applicable
06-28-2016
06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to read some data from another DWG. This works all fine excipt if the drawing is openend by anohter user. Can I force it to read from a "read-only"-version ?
Public Function zoekkaders(ByVal tekening As String) As Boolean
Dim myDWG As ApplicationServices.Document
Dim myEd As EditorInput.Editor
Dim myBlock As DatabaseServices.BlockReference
Dim myfilter(0), myfilter2(0) As DatabaseServices.TypedValue
myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument
myEd = myDWG.Editor
Dim db As New DatabaseServices.Database
If tekening <> "basis" Then
db = New DatabaseServices.Database(False, True)
Try
db.ReadDwgFile(tekening, System.IO.FileShare.Read, False, "")
Catch generatedExceptionName As System.Exception
myEd.WriteMessage(vbLf & "Unable to read drawing file.")
End Try
Else
db = New DatabaseServices.Database
db = myDWG.Database
End If
Using tr As Transaction = db.TransactionManager.StartTransaction()
Dim btable As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
....
Solved! Go to Solution.