Message 1 of 21
List names of BlkRefs selected.

Not applicable
12-06-2006
02:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
After typing all this i was begining to think it was long-winded so I'll trying to simplify here. I have an string array that contains block.names some of these substrings are the same. I want to filter this array so there's only one of each substring.
I think I found a function to help me:
Filter(sourcesrray, match[, include[, compare]])
but I'm unsure on how to implement it.
Long Version:
First I'll explain the "work-around" I have implemented so maybe you can see what i'm trying to do.
I have this tool that skips through blocks of the same name, zooming into each one individualy. The user can select which block he/she wants from a ComboBox that contains a list of blocks defined.
I get this list by iterating throught the Blocks collection, which shows blocks defined in the WHOLE drawing, and add Block.Names to a string array ONLY if there is a reference to it on the ActiveLayout. which means I have to make a SelectionSet of EVERY block defined in the drawing, filter that SelectionSet, and then if the SelSet.Count <> 0, I add that Block Name to the array. In a drawing with 150+ different blocks defined this is very inefficient and sloppy, but it's working.
Now I have the time and want to spruce this thing up a bit and I've come to a roadblock.
Instead of using the Blocks Collection i'm letting the user select the block refs to list. So the user makes this SelSet containing mutiple copies of, say, ten different block defintions. So I have this potential list but some blocks are listed many times. I need to widdle this down to one Block.Name string for each block in this array and then I can add it to the ComboBox.
I think I found a function to help me:
Filter(sourcesrray, match[, include[, compare]])
but I'm unsure on how to implement it.
Long Version:
First I'll explain the "work-around" I have implemented so maybe you can see what i'm trying to do.
I have this tool that skips through blocks of the same name, zooming into each one individualy. The user can select which block he/she wants from a ComboBox that contains a list of blocks defined.
I get this list by iterating throught the Blocks collection, which shows blocks defined in the WHOLE drawing, and add Block.Names to a string array ONLY if there is a reference to it on the ActiveLayout. which means I have to make a SelectionSet of EVERY block defined in the drawing, filter that SelectionSet, and then if the SelSet.Count <> 0, I add that Block Name to the array. In a drawing with 150+ different blocks defined this is very inefficient and sloppy, but it's working.
Now I have the time and want to spruce this thing up a bit and I've come to a roadblock.
Instead of using the Blocks Collection i'm letting the user select the block refs to list. So the user makes this SelSet containing mutiple copies of, say, ten different block defintions. So I have this potential list but some blocks are listed many times. I need to widdle this down to one Block.Name string for each block in this array and then I can add it to the ComboBox.