Batch block relinking

Hello,

would there be a way to batch relink blocks?

I have 34 3DMs linked as reference blocks. I like to copy paste their folder and then edit them individually for newer versions.

It would then be super useful to tell the block manager just the new path, and have it auto-relink wherever it finds the same 3DM filename. Right now I’m having to do this manually, and since the files are all network based, the block manager is very slow.

Thanks for any ideas.

Elefront has a import link blocks component. Be wary putting the file path in, the default block name is *.

image

Hello - it may be possible to script this, I’ll take a look later in the day - the idea is that all the linked files are moved en masse to the same new folder, correct?

-Pascal

Yes exactly.

I would suggest a “Relink” button in the BlockManager, that can take more than one block as input. It then asks for a folder, and only relinks blocks where the filenames match.

Hi Duncan - see if this helps for now - it seems to work as long as there are no name conflicts - but as always, test first…

BatchRelink.py (1.2 KB)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

Wow Pascal, it was pretty magical to see my big field of different linked blocks update definition by definition. This just saved me a lot of time. Thank you so much. I would very much like to plea for this to have a place in future versions of the block manager.

It goes in line with commands like ImportAnnotationStyles or importing Named Views, where here you are similarly importing blocks from, not a file, although this would also be interesting, but a folder. In this case the step where it would ask you which definition of the same name you want to use is already set to the given source.

Not sure how relevant you think this functionality would be, but for larger projects in offices like ours, with lots of linked blocks following a strict naming syntax, and which are being worked on by different people in a team, I feel this would be tremendously useful.