| | |
| | | var structFile = tempDir + "\\struct.json";
|
| | | var modelFile = tempDir + "\\model.rvt";
|
| | | var settingFile = tempDir + "\\setting.json";
|
| | | var otherFile = tempDir + "\\struct_others.json";
|
| | | if (File.Exists(structFile)) File.Delete(structFile);
|
| | |
|
| | | if (File.Exists(modelFile)) File.Delete(modelFile);
|
| | | if (!File.Exists(settingFile)) File.Create(settingFile).Close();
|
| | | if (!File.Exists(otherFile)) File.Create(otherFile).Close();
|
| | | File.Copy(_doc.PathName, modelFile);
|
| | | File.Copy(GlobalResource.ExportFilePath, structFile);
|
| | |
|
| | | var notContains = new List<string>() { "管道附件", "管道", "管件 ", "管道附件", "管道系统" };
|
| | | var c3 = new Autodesk.Revit.DB.FilteredElementCollector(_doc).WhereElementIsNotElementType();//.WhereElementIsElementType();
|
| | | var c4 = new Autodesk.Revit.DB.FilteredElementCollector(_doc).WhereElementIsElementType();
|
| | |
|
| | | c3.Concat(c4);
|
| | | var r = c3.Where(c => c.Category != null && !notContains.Any(c.Category.Name.Contains)).Select(c => new { ID = c.Id.ToString(), Name = c.Name, CategoryName = c.Category.Name, CategoryID = c.Category.Id.ToString() }).Distinct().ToList();
|
| | | var t = JsonHelper.ToJson(r);
|
| | | File.WriteAllText(otherFile, t);
|
| | |
|
| | | var setting = new SettingsViewModel() { Version = "1" };
|
| | | File.WriteAllText(settingFile, JsonHelper.ToJson(setting));
|
| | |
|
| | | var files = new string[] { structFile, modelFile, settingFile };
|
| | | var files = new string[] { structFile, modelFile, settingFile, otherFile };
|
| | | ZipFiles(files, zipFilePath);
|
| | |
|
| | | File.Delete(structFile);
|
| | | File.Delete(otherFile);
|
| | | File.Delete(modelFile);
|
| | | File.Delete(settingFile);
|
| | | return true;
|
| | |
| | | err = JsonHelper.ToJson(ex);
|
| | | return false;
|
| | | }
|
| | |
|
| | | }
|
| | | return true;
|
| | | else return false;
|
| | |
|
| | | }
|
| | |
|