| | |
| | | <!-- SG的DB库 --> |
| | | <add key="sgDB" value="E:\soft\SGConfig\catalog.db"/> |
| | | <!-- PG连接 --> |
| | | <add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/> |
| | | <add key="pgConn" value="Server=192.168.20.205;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/> |
| | | <add key="webpages:Version" value="3.0.0.0"/> |
| | | <add key="webpages:Enabled" value="false"/> |
| | | <add key="ClientValidationEnabled" value="true"/> |
| | |
| | | |
| | | namespace ExportMap.cs |
| | | { |
| | | /// <summary> |
| | | /// 模型转换工具 |
| | | /// </summary> |
| | | public class ConvertUtils |
| | | { |
| | | /// <summary> |
| | | /// 工作配置 |
| | | /// </summary> |
| | | public static string JobConfig = "{ \"format\": \"3dtiles\", \"mode\": 0, \"outputPath\": \"{0}\", \"outputOptions\": null, \"levelOfDetail\": -1, \"levelOfDetailText\": \"Auto\", \"georeferenced\": null }"; |
| | | public static string JobConfig = "{{ \"format\": \"3dtiles\", \"mode\": 0, \"outputPath\": \"{0}\", \"outputOptions\": null, \"levelOfDetail\": -1, \"levelOfDetailText\": \"Auto\", \"georeferenced\": null }}"; |
| | | |
| | | /// <summary> |
| | | /// Roamer.exe |
| | |
| | | string uploadFolder = Tool.GetSetting("uploadFolder"); |
| | | string tilesFolder = Path.Combine(Tool.GetSetting("lfData"), "3d\\3dtiles"); |
| | | |
| | | List<SysMeta> list = XYZUtils.selectMetas(ids, "type in ('ifc', 'fbx', 'rvt')"); |
| | | List<SysMeta> list = XYZUtils.selectMetas(ids, "and type in ('ifc', 'fbx', 'rvt')"); |
| | | if (null == list || list.Count == 0) return 0; |
| | | |
| | | foreach (SysMeta meta in list) |
| | | { |
| | | try |
| | |
| | | WriteText(configFile, string.Format(JobConfig, outPath)); |
| | | |
| | | ExecNavisworks(modelFile, configFile); |
| | | File.Delete(configFile); |
| | | |
| | | count++; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 运行Navisworks |
| | | /// </summary> |
| | | public static string ExecNavisworks(string modelFile, string outPath) |
| | | public static string ExecNavisworks(string modelFile, string configFile) |
| | | { |
| | | string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin SmartEarth \"{1}\" -NoGui -NoCache -Exit", modelFile, outPath); |
| | | string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin \"EngineBatch_Sample.SmartEarth\" \"{1}\" -NoGui -Exit", modelFile, configFile); |
| | | |
| | | Process p = new Process(); |
| | | p.StartInfo.UseShellExecute = false; |
| | |
| | | <script> |
| | | var token = "8e3f2499-b4e3-40b7-92bd-5ed1ce1c8b03"; |
| | | |
| | | // Ajax |
| | | function ajax(url, type, data, dataType, contentType, fn) { |
| | | $.ajax({ |
| | | url: url, |
| | |
| | | }); |
| | | } |
| | | |
| | | // 出图-1 |
| | | function exportMap1() { |
| | | var page = $("#selectPage").find("option:selected").text(); |
| | | var data = { |
| | |
| | | }); |
| | | } |
| | | |
| | | // 出图-2 |
| | | function exportMap2() { |
| | | var page = $("#selectPage").find("option:selected").text(); |
| | | var data = { |
| | |
| | | console.log(rs); |
| | | }); |
| | | } |
| | | |
| | | // 测试Rvt |
| | | function convert1() { |
| | | var data = { ids: [1521] }; |
| | | ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |
| | | }); |
| | | } |
| | | |
| | | // 测试Fbx |
| | | function convert2() { |
| | | var data = { ids: [1522] }; |
| | | ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |
| | | }); |
| | | } |
| | | |
| | | // 测试Ifc |
| | | function convert3() { |
| | | var data = { ids: [1524] }; |
| | | ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |
| | | }); |
| | | } |
| | | </script> |
| | | </head> |
| | | <body> |
| | |
| | | <input type="button" value="出图-2" onclick="exportMap2()" /> |
| | | <br /><br /> |
| | | |
| | | <a href="Convert/Test" >测试rvt</a> |
| | | <input type="button" value="测试Rvt" onclick="convert1();" /> |
| | | <input type="button" value="测试Fbx" onclick="convert2();" /> |
| | | <input type="button" value="测试Ifc" onclick="convert3();" /> |
| | | </body> |
| | | </html> |