TheSwamp
Code Red => VB(A) => Topic started by: David Hall on December 03, 2013, 01:54:09 PM
-
I cant seem to get my block names to write out to a file. I have my File Scripting Object working, but I am having trouble iterating through my block collection.
-
This is basically what I am doing
objSelset.Select acSelectionSetAll
Dim objblkname As AcadBlockReference
For Each objblkname In objSelset
MyFile.Writeline objblkname.Name
Next
I crashed autocad and I hadn't saved, so I put that together from memory
-
Part of the problem is some of the things in the selectionset aren't blocks, so there is no NAME property, so that is where it crashes. I can't seem to get it to only return inserted blocks
-
Hi David,
Seems like you need a property.available test.
-
either that or set up your selection set with a filter ;)
<edit> found a quick link with some info: http://adndevblog.typepad.com/autocad/2012/07/vba-how-to-setup-selectionset-filters-for-a-block-or-layer.html
-
Yep,
Will any of these blocks be dynamic?
If so, you may need to deal with EffectiveName for BlockReferences.
-
Thanks guys, that was what I needed. All is good