Esempio n. 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());
        }
Esempio n. 2
0
        public static RevitDoc OpenWithOptions(string modelPath, [DefaultArgument("Synthetic.Revit.WorksetConfigurationOpenAll()")] RevitDB.WorksetConfiguration worksetConfiguration, [DefaultArgument("false")] bool audit, [DefaultArgument("true")] bool reset)
        {
            Autodesk.Revit.UI.UIApplication uiapp = DocumentManager.Instance.CurrentUIApplication;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            RevitDoc doc = null;

            RevitDB.ModelPath path = RevitDB.ModelPathUtils.ConvertUserVisiblePathToModelPath(modelPath);

            RevitDB.OpenOptions openOptions = new RevitDB.OpenOptions();
            openOptions.Audit = audit;
            openOptions.SetOpenWorksetsConfiguration(worksetConfiguration);

            doc = app.OpenDocumentFile(path, openOptions);

            return(doc);
        }