-block in your code is a BlockTableRecord object, which is just a block
definition, not a block (BlockReference) inserted onto a drawing, so, it
does not lie on any layer (of course the entities that are part of the block
definition are on layer(s)).
Are you actually asking a block reference that is the reference to _block?
If so, it could be on any layer, and a BlockTableRecord may have many
BlockReferences on different layers.
wrote in message news:5232351@discussion.autodesk.com...
This is the code I have:
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim trans As Transaction = db.TransactionManager.StartTransaction()
Dim id As ObjectId
Dim bt As BlockTable = CType(trans.GetObject(db.BlockTableId,
OpenMode.ForRead), BlockTable)
For Each id In bt
Dim oName As String = CType(trans.GetObject(id,
OpenMode.ForRead), BlockTableRecord).Name
Dim _block As BlockTableRecord = CType(trans.GetObject(id,
OpenMode.ForRead), BlockTableRecord)
Next
_block.Name.ToString() will give me the name of the block but is there a way
to determine what layer that block is on?