Hi there,
Background Story
Let’s imagine a file that contains a number of linked / linked&embedded blocks.The block files are stored in a network folder, on a server that is very, very, very slow. The blocks can be nested somewhat arbitrarily. Since Rhino prioritizes the absolute path when resolving linked blocks, it’s no use to copy everything to the local machine, so opening the main file is excruciatingly slow. To add insult to injury, linked&embedded blocks seem to be considered as embedded when opening the file, so the block name conflict dialog keeps popping up.
The Task
Try to fix all the links at once before actually opening the rhino document : set the correct file path and set all linked&embedded to linked mode.
The Problem
var idef = file.AllInstanceDefinitions.FindName(idefName);
file.AllInstanceDefinitions.Delete(idefName);
file.AllInstanceDefinitions.AddLinked(correctFilePath, idefName, string.Empty);
AddLinked Adds a null entry to the table.
___
Note that relative file paths for linked blocks would solve half of the problem. From What I see it has been requested many times on the forum. May I ask again : What’s the problem with relative paths ?
___