[CommandMethod("DL2")]
public void DrawLine2()
{
PromptPointOptions PPO = new Autodesk.AutoCAD.EditorInput.PromptPointOptions("\nSelect Point");
PromptPointResult PPR ;
Point3d sp;
Point3d ep = new Point3d(4, 5, 0);
Database DB = Application.DocumentManager.MdiActiveDocument.Database;
using (Transaction tr = DB.TransactionManager.StartTransaction())
{
try
{
PPR= Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.GetPoint(PPO);
if (PPR.Status = Autodesk.AutoCAD.EditorInput.PromptStatus.OK)
{
Line lineEnt = new Line(sp, ep);
((BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(DB), OpenMode.ForWrite, false)).AppendEntity(lineEnt);
tr.AddNewlyCreatedDBObject(lineEnt, true);
}
}
finally
{
tr.Commit();
}
}
}
I cant seem to make this work. It is crashing on the if PPR.Status line