管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-03-14 7e52f7c8182689df70b283836c4de4123c0a5597
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
 
namespace ExportMap.cs
{
    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 ExecNavisworks(string modelFile, string outPath)
        {
            try
            {
                string exe = @"C:\Program Files\Autodesk\Navisworks Manage 2020\Roamer.exe";
                string cmd = string.Format("\"{0}\" -licensing AdLM -OpenFile \"{1}\" -ExecuteAddInPlugin SmartEarth \"{2}\" -NoGui -NoCache -Exit", exe, modelFile, outPath);
 
                Process p = new Process();
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.ErrorDialog = true;
                p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                p.StartInfo.RedirectStandardError = false;
                p.StartInfo.FileName = exe;
                p.StartInfo.Arguments = cmd;
                p.StartInfo.CreateNoWindow = true;
                p.Start();
 
                return string.Empty;
            }
            catch(Exception ex)
            {
                return ex.Message;
            }
        }
    }
}