- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I can't seem to find anyone who has ever done this and it is making me question if what I am doing is right.
At this stage I can get the layer table record that I want, but I cannot seem to find all of the ObjectIDs that are referenced by this record. Does anyone know if/how this can be done?
Dim ltr As LayerTableRecord = GetLayerRecord("Chk")
So I know that I have one polyline in model space and I have one nested circle in a block. 100% guaranteed.
I have tried the selectAll function but the selection constantly has a 5001 error which is caused by removing the polyline in mode space because the nested entity is the one I want ultimately.
Dim tvs As TypedValue() = New TypedValue(0) {New TypedValue(CInt(DxfCode.LayerName), "chk")}
Dim sf As SelectionFilter = New SelectionFilter(tvs)
Dim psr As PromptSelectionResult = ed.SelectAll(sf)
So this is why I am trying it as I have mentioned. I have used the MGSnoopDB and found what i want there, but does necessarily mean it can be done in vb? Screenshot attached...
All I want is a list of the base entities (ie Circle, Polyline etc) that are on the layer identified. Can this be done and how?
Now this works, but only because these are in model space and not nested, so any help in making me understand how to do this would be a fantastic help!
Dim btr As BlockTableRecord = tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite)
Dim b As IEnumerable(Of ObjectId) = btr.Cast(Of ObjectId)()
' Grab full list of mains!
Dim mainscons As List(Of ObjectId) = (From id In b
Select id Where (CType(tr.GetObject(id, OpenMode.ForRead), Entity)).Layer.StartsWith("chklayer")).ToList
Solved! Go to Solution.