Message 1 of 4
TransmissionData causing error for Local Revit file.

Not applicable
12-27-2018
11:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
I tried to using TransmissionData to unload all the Revit link before open it. But it seems like when I apply it for a Local Revit file, it make the local file disconnected with the central file and Revit ask to save it as Central file.
So if anyone have some experience with this issue, please help me :).
Thank you so much
BasicFileInfo fileInfo = BasicFileInfo.Extract(s); if(fileInfo.IsCentral==false) { ModelPath mp = ModelPathUtils.ConvertUserVisiblePathToModelPath(@s); TransmissionData transmis = TransmissionData.ReadTransmissionData(mp); ICollection<ElementId> linkID = transmis.GetAllExternalFileReferenceIds(); foreach (ElementId elementId in linkID) { ExternalFileReference extRef = transmis.GetLastSavedReferenceData(elementId); ModelPath linkpath = extRef.GetPath(); if (extRef.ExternalFileReferenceType == ExternalFileReferenceType.RevitLink && ModelPathUtils.ConvertModelPathToUserVisiblePath(linkpath).ToString().Contains(Path.GetFileNameWithoutExtension(s)) == false ) { //TaskDialog.Show("Revit link", ModelPathUtils.ConvertModelPathToUserVisiblePath(linkpath).ToString()); transmis.SetDesiredReferenceData(elementId, linkpath, extRef.PathType, false); } } transmis.IsTransmitted = true; TransmissionData.WriteTransmissionData(mp, transmis);