Message 1 of 9
GetBlockReferenceIds Problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to call the BlockTableRecord GetBlockRefenceIds function to get a list of all BlockRefences on that a Layout, but not matter what I try it always returns 0. Here is what my test looks like: A drawing with two PaperSpace layouts each with a few BlockReferences, in addtion some more BlockReferences are in the ModelSapce. Here is my code:
db = HostApplicationServices.WorkingDatabase
blt = CType(Tran.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
btr = CType(Tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead), BlockTableRecord)
IdList = btr.GetBlockReferenceIds(True, True)
If IdList.Count > 0 Then
Stop
End IfI am setting the current layout before executing the code. It does not matter if I change it and instead of using "db.CurrentSpaceId" I use "blt(BlockTableRecord.ModelSpace) or .PaperSpace. This function always returns 0. Please help before I go nuts.