1. Jan
  2. General
  3. Wednesday, 01 February 2017
  4.  Subscribe via email
How to unload all links ( Revit, CAD, Pointcloud, IFC ) from revit in C# macro ?
Rate this post:
Mody Accepted Answer Pending Moderation
0
Votes
Undo
Try :


// Unload all links
var loadedExternalFilesRef = new List<RevitLinkType>();
var collector = new FilteredElementCollector(document);
foreach (Element element in collector.OfClass(typeof(RevitLinkType)))
{
ExternalFileReference extFileRef = element.GetExternalFileReference();
if (null == extFileRef || extFileRef.GetLinkedFileStatus() != LinkedFileStatus.Loaded)
continue;
var revitLinkType = (RevitLinkType)element;
loadedExternalFilesRef.Add(revitLinkType);
revitLinkType.Unload(null);
}
  1. more than a month ago
  2. General
  3. # 1
Adem Accepted Answer Pending Moderation
1
Votes
Undo
TransmissionData transData = TransmissionData.ReadTransmissionData(location);
if (transData != null)
{
ICollection<ElementId> externalReferences = transData.GetAllExternalFileReferenceIds();
foreach (ElementId refId in externalReferences)
{
ExternalFileReference extRef = transData.GetLastSavedReferenceData(refId);

if (extRef.ExternalFileReferenceType == ExternalFileReferenceType.RevitLink)
{
transData.SetDesiredReferenceData(refId, extRef.GetPath(), extRef.PathType, false);
}
}
transData.IsTransmitted = true;
TransmissionData.WriteTransmissionData(location, transData);
}
  1. more than a month ago
  2. General
  3. # 2
Jan Accepted Answer Pending Moderation
Staff
0
Votes
Undo
Thanks Adem ;)
  1. more than a month ago
  2. General
  3. # 3
Jade Barnet Accepted Answer Pending Moderation
0
Votes
Undo
  1. more than a month ago
  2. General
  3. # 4
Abby Noble Accepted Answer Pending Moderation
0
Votes
Undo
A lot of people have asked about the Revit and this is almost everyone's question. This post can tell about that question and the essay writing service australia is also doing a lot of beneficial things for encouraging people towards essay writing and it helps them in their university studies too. I like this post and I will tell about it to everyone that I know.
  1. 4 weeks ago
  2. General
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,jpeg,zip,rar,pdf,doc
• Insert • Remove Upload Files (Maximum File Size: 5 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.

Latest replies

I have read about The Full Monty before and I was ...
Consideration of all barriers is very important fo...
A case building and all offers have been identifie...