![]() make sure the IsTransmitted property is set TransData.SetDesiredReferenceData(refId, extRef.GetPath(), extRef.PathType, false) we only want the links to be unloaded (shouldLoad = false) we do not want to change neither the path nor the path-type If (extRef.ExternalFileReferenceType = ExternalFileReferenceType.RevitLink) ICollection externalReferences = transData.GetAllExternalFileReferenceIds() įoreach (ElementId refId in externalReferences)ĮxternalFileReference extRef = transData.GetLastSavedReferenceData(refId) collect all (immediate) external references in the model TransmissionData transData = TransmissionData.ReadTransmissionData(location) access transmission data in the given Revit file / However, nested links will be unloaded if their parent links are unloaded, so this function only needs to look at the document's immediate links. / The TransmissionData for a given document only contains top-level Revit links, not nested links. ![]() / This method will set all Revit links to be unloaded the next time the document at the given location is opened. Void UnloadRevitLinks(ModelPath location) The following example reads the TransmissionData for a file at the given location and sets all Revit links to be unloaded the next time the document is opened. If AddExternalFileReference is called using an ElementId which does not correspond to an element which is an external file reference, the information will be ignored on file load. TransmissionData cannot add or remove references to external files. For example, calling WriteTransmissionData with a TransmissionData object which has had all references set to LinkedFileStatus.Unloaded would cause no references to be loaded upon next opening the document. The methods ReadTransmissionData and WriteTransmissionData can be used to obtain information about external references, or to change that information. It also stores load state and path information for what Revit should do the next time the document is opened.Īs such, TransmissionData can be used to perform operations on external file references without having to open the entire associated Revit document. This means that it stores the load state and path of the reference from the most recent time this TransmissionData's document was opened. TransmissionData stores information on both the previous state and requested state of an external file reference. (Note that it will not return the ids of nested Revit links it only returns top-level references.) This utility class has two other methods, IsExternalFileReference() and GetExternalFileReference() which perform the same function as the similarly named methods of the Element class, but can be used when you have an ElementId rather than first obtaining the Element. ![]() TheExternalFileUtils.GetAllExternalFileReferences() method returns a collection of ElementIds of all elements that are external file references in the document. As its name implies, this utility class provides information about external file references. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |