Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am hoping someone can help me with what I can only assume is something easy but stumps me:
I have add an xrecord to the extension data of several entities. In this instance Polylines. The record name is "MyData".
All I want to do is get all of these items using LINQ if possible. I am sure I have seen it done in an example skipped over long ago, but not sure.
Using tr As Transaction = db.TransactionManager.StartTransaction()
Dim bt As BlockTable = tr.GetObject(db.BlockTableId, OpenMode.ForWrite)
Dim acBlkTblRec As BlockTableRecord = tr.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
Dim b As IEnumerable(Of ObjectId) = acBlkTblRec.Cast(Of ObjectId)()
' This works!, but i still have to iterate to find the record name
Dim testRes1 As List(Of ObjectId) = (From id In b
Where Not (CType(tr.GetObject(id, OpenMode.ForRead), ntity).ExtensionDictionary.IsNull)
Select id).ToList
' There must be a way to convert this into the extension dictionary and then see if the xRecord name exists??
Dim testRes1 As List(Of ObjectId) = (From id In b
Where Not (CType(tr.GetObject(id, OpenMode.ForRead), Entity).ExtensionDictionary.IsNull)
Select xRec Where( TryCast(tr.GetObject(id, OpenMode.ForRead), ExtensionDictionary).Contains("MyData").ToList
End using
How do I create the DBDictionary I need to use it in the LINQ function??
Solved! Go to Solution.