Message 1 of 31
How to get Block's Layer name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
After searching for a long time on the web, does anyone know how to get the block's layer name?
I iterate through Blocks to get informations but i'm not able to code the source to obtain what i want?
Sample source taken from AutoCAD.NET site:
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
'' Open the Block table for read
Dim acBlkTbl As BlockTable = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
'' Open the Block table record Model space for read
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForRead)
'' Step through the Block table record
For Each acObjId As ObjectId In acBlkTblRec
acDoc.Editor.WriteMessage(vbLf & "DXF name: " & acObjId.ObjectClass().DxfName)
acDoc.Editor.WriteMessage(vbLf & "ObjectID: " & acObjId.ToString())
acDoc.Editor.WriteMessage(vbLf & "Handle: " & acObjId.Handle.ToString())
acDoc.Editor.WriteMessage(vbLf)
Next
'' Dispose of the transaction
End UsingMaybe use nested transaction to iterate through LayerTableId?
ideas?