@andreas7ZYXQ wrote:
....
It works just as i want exept for a small detail.
If i have 10 blocks with the same name it will change all ten even if i just select one of them.
Correct me if im wrong. Im trying to learn, but is it possible to get the (-1 . <Entity name: 1aa711490e0>) for each selected block and just apply the change to them?
....
You can't do it that way with ordinary Blocks. It's the nature of changing something in a Block definition -- every Block of the same name gets the same change. That's why the routine makes a list of Block names, checking for each selected Block whether its name is already in the list, because there's no point in changing the definition of a Block more than once.
Otherwise, the benefit to a Block definition is gone -- the memory savings from the collective definition and the fact that their ingredients are all the same [they vary only as to their insertion points/scales/rotations, with further dimensional variabilities in Dynamic Blocks (but see below) and/or textual variabilities via Attributes]. To have them be different in the way you describe would, I think, mean Exploding all those Blocks and changing the Layer of the Block that was formerly nested in them all. Or, you could pull the nested Block out of the parent Block's definition and Insert one on the Layer you want at the Insertion point of each of the other Blocks. But that would also remove them from the Blocks you don't want to change, so you'd have to add the formerly-nested Block at each of those, too, on some Layer or other.
You could also do what you're asking by changing the Layer of the nested Block to Layer 0 in the Block definition, rather than to your target Layer, and then changing the Layer of the parent Block to the target Layer [because of the characteristics of Layer 0 in relationship to Block definitions]. Would that work? It would depend on there not being other things drawn on Layer 0 in the parent Block's definition.
[I'm not fully up to speed on Dynamic Blocks -- if there's a way for their Dynamism to include the Layers of objects in them, including nested Blocks, it may be possible, but others will need to help with that, unless and until I dig into them.]
Kent Cooper, AIA