Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been using this to get access to attributes in a blockReference
foreach (ObjectId objectId in block.AttributeCollection)
But today, I exploded a block to get it's child blocks and I wanted to iterate over the child block Attribute collection.
But I got an invalid cast exception at the above line.
When I looked at the
block.AttributeCollection
I found it had actual AttributeReferences inside and not the ObjectIds I was expecting.
How on earth are we to deal with a collection which does not know what it is a collection of: a collection of ObjectIds or a collection of actual AttributeReferences?
Anyone come across this and got a good way of dealing with this?
Solved! Go to Solution.