Message 1 of 14
Reload Link CAD
Not applicable
02-10-2016
12:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I wonder if we could programmatically reload linked CAD in Revit
This need comes from my actual works since I usually reload linked CAD to keep track of the changes every time the linked CAD is revised. And I found it extremely annoying when I need to repeatedly open the Manage Links >> switch to CAD Formats >> find a link in the very long list of Linked CAD >> Reload
I skimmed through many posts related to this issue but none of them seem to be able to address this issue
I am playing around with the outline idea shown in the below code
Hope to some can help me out
Thank you
Nguyen Duy Hoa
public void ReloadLinkedCAD(Document doc)
{
IList<ImportInstance> importIntaces = new FilteredElementCollector(doc).OfClass(typeof(ImportInstance)).Cast<ImportInstance>().Where(i => i.IsLinked == true).ToList();
using (Transaction t = new Transaction(doc, "Reload Imports"))
{
t.Start();
foreach (ImportInstance ints in importIntaces)
{
if (ints.Category.Name.EndsWith(".dwg"))
{
ElementId typeId = ints.GetTypeId();
CADLinkType cadLink = doc.GetElement(typeId) as CADLinkType;
//How to reload cadLink?
}
}
t.Commit();
}
}