public static string LoadFrom(DynElem LinkType, string FilePath) { RLinkType rLinkType = (RLinkType)LinkType.InternalElement; RevitDB.ModelPath linkpath = RevitDB.ModelPathUtils .ConvertUserVisiblePathToModelPath(FilePath); RevitDB.LinkLoadResult linkLoadResult; linkLoadResult = rLinkType.LoadFrom(linkpath, new RevitDB.WorksetConfiguration()); return(linkLoadResult.ToString()); }
public static string ReloadFrom(global::Revit.Elements.Element revitLinkType, string path) { Autodesk.Revit.DB.RevitLinkType internalLinkType = revitLinkType.InternalElement as Autodesk.Revit.DB.RevitLinkType; ModelPath mPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(path.Replace(Char.Parse("//"), '/')); TransactionManager.Instance.ForceCloseTransaction(); LinkLoadResult loadResult = internalLinkType.LoadFrom(mPath, new WorksetConfiguration()); return(string.Format( "Result = {0}", loadResult.LoadResult)); }