using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Windows;
[assembly: CommandClass(typeof(TestLineTypeDialog.Utils))]
namespace TestLineTypeDialog
{
public class Utils
{
[CommandMethod("LTDialog")]
public void MyCommand()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
LinetypeDialog dlg = new LinetypeDialog();
dlg.IncludeByBlockByLayer = false;
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if (dlg.Linetype.IsNull) {
ed.WriteMessage("\nLinetype = null");
} else {
using (LinetypeTableRecord ltr = dlg.Linetype.Open(OpenMode.ForRead) as LinetypeTableRecord)
{
ed.WriteMessage("\nLinetype = {0} ({1})", ltr.Name, dlg.Linetype);
}
}
}
}
}
}