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;
|
}
|
}
|
}
|
}
|