Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
List<Element> rvtLinks = new FilteredElementCollector(doc).OfClass(typeof(RevitLinkInstance))
.ToList();
foreach (Element link in rvtLinks)
{
RevitLinkType linkType = link as RevitLinkType;
if (linkType != null)
{
LinkLoadResult loadResult = linkType.LoadFrom(newModelPath, new WorksetConfiguration());
}
else if (link.Name.Contains("Record EC -"))
{
RevitLinkOptions linkOptions = new RevitLinkOptions(false);
LinkLoadResult loadResult = RevitLinkType.Create(doc, newModelPath, linkOptions);
LogTrace($"modelPath directory: {loadResult.ElementId}");
}
//Document linkDoc = link.GetLinkDocument();
}
I'm collecting my linked models and I'm interested in the cases where the link as RevitLinkType return null values as those are the ones that I wish to reload from a local path, particularly for the following 2nd listed model:
I have not found a way to achieve that. All I can do so far with null values is to create a new revit link type. However, this does not fix the issue because the outcome is a revit file linked to the root model at a default location. Instead, I only want to reload them since those models have been already moved and aligned at a certain position.
How can I use the "reload from" command for those listed linked models??
Solved! Go to Solution.