示例#1
0
        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());
        }
示例#2
0
        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));
        }