OK, so the problem is that you are renaming a block in the drawing and then trying to insert THAT block at another scale...therein lies your problem. You need to:
1. Save your base block BA-SYMB to disk
2. When you go to insert it, get the scale and check if the block BA-SYMB- & SCALE is in the drawing.
3. If not, insert the block from the disk file, NOT ANY VERSION ALREADY IN THE DRAWING. If it already exists skip to 5
4. Run the block & layer rename routine. Now you will won't have the BA-SYMB in your drawing again, so the next time you insert from the FILE, your code to rename will work just fine.
5. Insert the block as desired.......
So if all goes well, and you've inserted your block at both 48 & 96 scales, your block table would show: "BA-SYMB-48" & "BA-SYMB-96" but there would be NO "BA-SYMB"
Does that makes sense?
Jeff
Hey Jeff
Thanks again
I am not sure if you are following me exactly but almost.
If you look at the code that I posted, I think it pretty much explains it.
OK,
Insert block at 48, the layer names in that block become layernames-48
Insert that block again at 96, those layers become layernames-96
Now, I want to be able to freeze, turn off etc each layer without effecting other layers but that isn't happening.
I beleive it is due to the fact that after the second block is inserted, you need to redefine it, therefore all layers take the side of the last block insert.
Does that make better sense?
Thanks again
Mark
Jeff,
I am trying this approach: User inserts first block to scale, let's say 48,
Macro is ran. The layers get made accordingly,all is working well.
The problem is when we insert another one, so I try moving the firsrt one into place and exploding it, then I insert the second one, run the macro. The layers (the way I want them) are not created.
If I delete the first block that is exploded, then the layers for the second one will be created (layername-xscalefactor) which is no good, I need both to work.
So, my conclusion is that there is objects in the exploded block that were exposed after the block was exploded that my code doesn't like
I've since added a condition: