.NET

.NET

Reply
*Expert Elite*
1,087 Posts
217 Kudos
Registered: ‎04-27-2009
Post 11 of 12

Re: How to iterate through block values?

04-02-2014 02:02 PM in reply to: slecompte

Change this:

 

'' get all dynamic blockreferences
            If btr.IsDynamicBlock Then
                Dim brIds As ObjectIdCollection = btr.GetAnonymousBlockIds()
                For Each id As ObjectId In brIds
                    Dim br As BlockTableRecord = _
                        DirectCast(tr.GetObject(id, OpenMode.ForRead), BlockTableRecord)
                    ids = br.GetBlockReferenceIds(True, True)
                    For Each id As ObjectId In ids
                        brefIds.Add(id)
                    Next
                Next
            End If

 

To This:

 

'' get all dynamic blockreferences
            If btr.IsDynamicBlock Then
                Dim brIds As ObjectIdCollection = btr.GetAnonymousBlockIds()
                For Each id As ObjectId In brIds
                    Dim br As BlockTableRecord = _
                        DirectCast(tr.GetObject(id, OpenMode.ForRead), BlockTableRecord)
                    ids = br.GetBlockReferenceIds(True, True)
                    For Each idd As ObjectId In ids
                        brefIds.Add(idd)
                    Next
                Next
            End If

Contributor
12 Posts
0 Kudos
Registered: ‎01-27-2014
Post 12 of 12

Re: How to iterate through block values?

04-02-2014 07:56 PM in reply to: norman.yuan

That worked great.  Thank you sincerely for helping me with this.

It is much appreciated.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!