示例#1
0
        public static List <List <string> > GetRevitYearList(string[] FilePath, string prjNum)
        {
            List <List <string> > cont      = new List <List <string> >();
            List <List <string> > BuildYear = new List <List <string> >();

            foreach (var k in FilePath)
            {
                var fileName = GetFilesinFolders(k, prjNum);
                //cont.Add(fileName);
            }
            var fileNames = cont.SelectMany(d => d).ToList();

            foreach (var i in fileNames)
            {
                List <string>        Holding = new List <string>();
                List <string>        catch1  = BasicFileInfo.Main(i.ToString());
                IEnumerable <string> catch2  = catch1.Where(s => s.StartsWith("Revit Build"));
                IEnumerable <string> catch4  = catch1.Where(s => s.StartsWith("Central Model Path"));
                var catch3 = catch2.Cast <string>().ToList().FirstOrDefault <string>();
                var catch5 = catch4.Cast <string>().ToList().FirstOrDefault <string>();

                Holding.Add(catch3);
                Holding.Add(catch5);

                BuildYear.Add(Holding);
            }

            return(BuildYear);
        }
示例#2
0
        internal static List <dynamic> GetRevitInfo(List <string> FileName)
        {
            List <dynamic> BuildYear = new List <dynamic>();

            foreach (var i in FileName)
            {
                List <string> Holding = new List <string>();
                List <string> catch1  = BasicFileInfo.Main(i.ToString());
                if (catch1 != null)
                {
                    IEnumerable <string> build = catch1.Where(s => s != null && s.StartsWith("Revit Build"));
                    System.Diagnostics.Debug.WriteLine("Find Revit Build: " + build);
                    IEnumerable <string> path = catch1.Where(s => s != null && s.StartsWith("Central Model Path"));
                    System.Diagnostics.Debug.WriteLine("Find Central Path: " + path);
                    var buildExpand = build.Cast <string>().ToList().FirstOrDefault <string>();
                    var cenMod      = path.Cast <string>().ToList().FirstOrDefault <string>();
                    //Revit 2014 (and potentially earlier) do not have a Revit Build parameter, returning 2018.
                    buildExpand = ExtractYear(buildExpand);

                    Holding.Add(buildExpand);
                    Holding.Add(cenMod);

                    BuildYear.Add(Holding);
                }
                else
                {
                    BuildYear.Add(null);
                };
            }
            ;

            return(BuildYear);
        }