How to Unload CAD file links from Revit model without delete ting it.

How to Unload CAD file links from Revit model without delete ting it.

archana.sapkal
Participant Participant
470 Views
6 Replies
Message 1 of 7

How to Unload CAD file links from Revit model without delete ting it.

archana.sapkal
Participant
Participant

How to unload CAD links from Revit model .

FilteredElementCollector importCollector = new FilteredElementCollector(doc).OfClass(typeof(ImportInstance));
List<ElementId> cadImportIdsToRemove = importCollector.Cast<ImportInstance>().Where(importInstance => importInstance.IsLinked).Select(importInstance => importInstance.Id).ToList();

if (cadImportIdsToRemove.Count > 0)
{
using (Transaction transCAD = new Transaction(doc, "Delete All CAD Imports"))
{
FailureHandlingOptions failOptions = transCAD.GetFailureHandlingOptions();
failOptions.SetFailuresPreprocessor(new CustomFailuresPreprocessor());
transCAD.SetFailureHandlingOptions(failOptions);
transCAD.Start();
try
{
doc.Delete(cadImportIdsToRemove);
}
catch (Exception ex)
{
transCAD.RollBack();
return;
}

transCAD.Commit();
}

Here I'm deleting links but need to unload links ,How  to possible Unload for CAD files.

 

0 Likes
471 Views
6 Replies
Replies (6)
Message 2 of 7

azad.Nanva
Advisor
Advisor

Why do i need this ?

If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 3 of 7

archana.sapkal
Participant
Participant

The need to unload CAD file links without deleting them arises when you want to temporarily disable or detach the link for performance or workflow reasons, but still retain the option to reload it later. Deleting the CAD link removes the file permanently from the project, and reloading it would require you to re-import and re-link the file manually.

 

0 Likes
Message 4 of 7

archana.sapkal
Participant
Participant

The need to unload CAD file links without deleting them arises when you want to temporarily disable or detach the link for performance or workflow reasons, but still retain the option to reload it later. Deleting the CAD link removes the file permanently from the project, and reloading it would require you to re-import and re-link the file manually.

0 Likes
Message 5 of 7

azad.Nanva
Advisor
Advisor

so , just unload the link!

If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 6 of 7

archana.sapkal
Participant
Participant

yes, But for unload their is no any api ,I'm able to unload Revit link using API but unable to unload CAD files link using API

0 Likes
Message 7 of 7

azad.Nanva
Advisor
Advisor

https://stackoverflow.com/questions/41915363/how-to-unload-all-links-revit-cad-pointcloud-ifc-from-r...

If it solves your problem, please click Accept to enhance the Forum.
0 Likes