| | |
| | | using Autodesk.Revit.DB;
|
| | | using HStation.RevitDev.Model.ModelEnum;
|
| | | using HStation.RevitDev.RevitDataExport.Common;
|
| | | using HStation.RevitDev.RevitDataExport.Entity;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Linq;
|
| | |
|
| | |
| | | ConfigRecord record = records.ConfigRecords.Where(x => x.FilePath == filePath)?.FirstOrDefault();
|
| | | if (record != null)
|
| | | {
|
| | | GlobalResource.RevitModels = record.Record;
|
| | | GlobalResource.RevitModels.Add(new Tuple<string, Dictionary<RevitType, List<string>>>(doc.Title, record.Record));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var record = new ConfigRecord
|
| | | {
|
| | | FilePath = GlobalResource.LastFilePath,
|
| | | Record = GlobalResource.RevitModels
|
| | | Record = GlobalResource.RevitModels.Find(x=>x.Item1 == doc.Title)?.Item2
|
| | | };
|
| | | if (!File.Exists(GlobalResource.RecordFilePath))
|
| | | {
|
| | | File.Create(GlobalResource.RecordFilePath);
|
| | | }
|
| | |
|
| | | var cache = File.ReadAllText(GlobalResource.RecordFilePath);
|
| | | Records records = new Records();
|
| | | if (!string.IsNullOrEmpty(cache))
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | configRecord = record;
|
| | | configRecord.Record = record.Record;
|
| | | }
|
| | |
|
| | | var config = Newtonsoft.Json.JsonConvert.SerializeObject(records);
|