I am starting to daydream about a script that swaps out block instances for low-detail, perhaps already meshed, equivalents or vice versa back to the OG NURBS version.
Logic would be something like
step through all the objects in the scene
is it a linked block? if yes
does it’s name contain a code like starting with hi- (etc.) if yes
get it’s path and look for same name but with lo- or whatever. if fount then
swap the paths
next
One initial question… I can see how to get the block’s path… but nothing about changing it? Do I have to delete the block definition and insert the replacement as a new definition? Would I then lose all the instances? Need some help on the logic before I dig into this.
if the low and high resolution blocks are both instances of the same document and one of them is placed mutliple times you might just do the swapping using _ReplaceBlock in a macro using the desired block names.
So there would be no need to change any reference paths. Or do i misunderstand the task ?
No user prompts. Name the low poly blocks ending in -lp and the detailed blocks -og. It just swaps everything in the file. No frills. It just skips blocks that don’t have a -lp or -og suffix.
In the original script there was a line that was matching the attributes from the original block to the newly inserted replaced block. Looks like one of the attributes is grouping, too.
So you may want to use this: