Message 1 of 4
Not applicable
01-03-2013
03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI all.
So i have 3 file DWG :
3.dwg : is a plan 'archi'
2.dwg is a plan with only décoration.
1. dwg is a plan with only the water.
i have this structure in my file (1.dwg) :
1.dwg
---> 2..dwg
---------> 3.dwg (this file is a Xref of 2.dwg)
--> is the blockRefecence (XRef).
my code :
Dim CollXref As New ObjectIdCollection
Dim mydb As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim myTrans As Transaction = mydb.TransactionManager.StartTransaction
'
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim DocLock As DocumentLock = doc.LockDocument
Try
Dim BlocTable As BlockTable = CType(myTrans.GetObject(mydb.BlockTableId, OpenMode.ForRead), BlockTable)
For Each btid As ObjectId In BlocTable
Dim DefBloc As BlockTableRecord = CType(myTrans.GetObject(btid, OpenMode.ForWrite), BlockTableRecord)
'
If DefBloc.IsFromExternalReference = True Then
If DefBloc.IsResolved = False Then
....
Else
CollIdXref.Add(btid)
End If
End If
Next
myTrans.Commit()
Catch ex As Exception
MsgBox(ex.Message, vbOKOnly & vbCritical, "ee")
Finally
myTrans.Dispose()
End Try
DocLock.Dispose()
DocLock = Nothing
So i don't want to add Id of a Xref From a Xref. (In my example i want only ObjectId of the 2.dwg not 3.dwg if i launch this code on 1.dwg.
How i can do that ?
Solved! Go to Solution.