Message 1 of 3
Faster Way to Find Specific Block?

Not applicable
10-05-2007
08:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to find a block in PaperSpace called TitleBlock. If there will always be only one instance of it, is there a quicker way to find it than cycling thru all of the entities?
Dim objFndIN As AcadEntity
Dim attsIN As Variant
For Each objFndIN In ThisDrawing.PaperSpace
If TypeOf objFndIN Is AcadBlockReference Then
Set oblkRefIN = objFndIN
If StrComp(UCase(oblkRefIN.Name), "TITLEBLOCK", 1) = 0 Then
'/// FOUND IT
Exit For
End If
End If
Next objFndIN
If it's a complex drawing, this may take a while, and if I have to repeat it a hundred times or more, it really takes a long time.
Seems like if you know its name, there should be a quicker way to find it.
Any ideas?
Thanks.
Dim objFndIN As AcadEntity
Dim attsIN As Variant
For Each objFndIN In ThisDrawing.PaperSpace
If TypeOf objFndIN Is AcadBlockReference Then
Set oblkRefIN = objFndIN
If StrComp(UCase(oblkRefIN.Name), "TITLEBLOCK", 1) = 0 Then
'/// FOUND IT
Exit For
End If
End If
Next objFndIN
If it's a complex drawing, this may take a while, and if I have to repeat it a hundred times or more, it really takes a long time.
Seems like if you know its name, there should be a quicker way to find it.
Any ideas?
Thanks.