管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-03-14 7e52f7c8182689df70b283836c4de4123c0a5597
ExportMap/cs/ConvertUtils.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
@@ -7,6 +8,34 @@
{
    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;
            }
        }
    }
}