| | |
| | | public static int Convert(XYZArgs args) |
| | | { |
| | | int count = 0; |
| | | string uploadFolder = Tool.GetSetting("uploadFolder"); |
| | | string tilesFolder = Path.Combine(Tool.GetSetting("lfData"), "3d\\3dtiles"); |
| | | string uploadFolder = Tools.GetSetting("uploadFolder"); |
| | | string tilesFolder = Path.Combine(Tools.GetSetting("lfData"), "3d\\3dtiles"); |
| | | |
| | | List<SysMeta> list = XYZUtils.selectMetas(args.ids, "and type in ('ifc', 'fbx', 'rvt')"); |
| | | List<SysMeta> list = XYZUtils.SelectMetas(args.ids, "and type in ('ifc', 'fbx', 'rvt')"); |
| | | if (null == list || list.Count == 0) return 0; |
| | | |
| | | foreach (SysMeta meta in list) |
| | |
| | | string modelFile = Path.Combine(uploadFolder, meta.path); |
| | | if (!File.Exists(modelFile)) continue; |
| | | |
| | | string configFile = Path.Combine(Tool.TempDir, ExportUtil.DateStr + ".json"); |
| | | string configFile = Path.Combine(Tools.TempDir, ExportUtil.DateStr + ".json"); |
| | | string outPath = Path.Combine(tilesFolder, meta.type, meta.id.ToString()); |
| | | string jsonFile = Path.Combine(outPath, "tileset.json"); |
| | | |
| | |
| | | File.Delete(configFile); |
| | | if (File.Exists(jsonFile)) |
| | | { |
| | | string path = jsonFile.Replace(Tool.GetSetting("lfData") + "\\", ""); |
| | | string path = jsonFile.Replace(Tools.GetSetting("lfData") + "\\", ""); |
| | | InsertToDB(meta, args, path); |
| | | |
| | | count++; |