| | |
| | | var record = new ConfigRecord
|
| | | {
|
| | | FilePath = GlobalResource.LastFilePath,
|
| | | Record = GlobalResource.RevitModels.Find(x=>x.Item1 == doc.Title)?.Item2
|
| | | Record = GlobalResource.RevitModels.Find(x => x.Item1 == doc.Title)?.Item2
|
| | | };
|
| | | if (!File.Exists(GlobalResource.RecordFilePath))
|
| | | {
|
| | |
| | | File.WriteAllText(GlobalResource.RecordFilePath, config);
|
| | | }
|
| | |
|
| | | public static bool ExportZipFile(Document _doc)
|
| | | public static bool ExportZipFile(Document _doc, out string err)
|
| | | {
|
| | | FolderBrowserDialog dialog = new FolderBrowserDialog();
|
| | | err = "";
|
| | | if (dialog.ShowDialog() == DialogResult.OK)
|
| | | {
|
| | | try
|
| | |
| | | if (File.Exists(modelFile)) File.Delete(modelFile);
|
| | | if (!File.Exists(settingFile)) File.Create(settingFile).Close();
|
| | | File.Copy(_doc.PathName, modelFile);
|
| | | File.Copy(GlobalResource.RecordFilePath, structFile);
|
| | | File.Copy(GlobalResource.ExportFilePath, structFile);
|
| | |
|
| | | var setting = new SettingsViewModel() { Version = "1" };
|
| | | File.WriteAllText(settingFile, JsonHelper.ToJson(setting));
|
| | |
| | | }
|
| | | catch (Exception ex) |
| | | { |
| | | err = JsonHelper.ToJson(ex); |
| | | return false; |
| | | }
|
| | |
|