2个简单的输出信息和2个弹出winform窗口
#region 输出字符串
/// <summary>
/// 输出字符串
/// </summary>
/// <param name="msg"></param>
public static void WriteMessage(string msg)
{
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage(msg);
}
#endregion
#region autocad弹出信息
/// <summary>
/// autocad弹出信息
/// </summary>
/// <param name="msg"></param>
public static void ShowAlertDialog(string msg)
{
Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(msg);
}
#endregion
#region 弹出windowsForm窗口
/// <summary>
/// 通过autocad函数弹出windowsForm窗口,该方法是将窗口置前,锁住当前窗口
/// </summary>
/// <param name="frm"></param>
public static void ShowModalDialog(System.Windows.Forms.Form frm)
{
Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(frm);
}
/// <summary>
/// 通过autocad函数弹出windowsForm窗口,该弹出窗口没有被锁定
/// </summary>
/// <param name="frm"></param>
public static void ShowModelessDialog(System.Windows.Forms.Form frm)
{
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(frm);
}
#endregion