我写了这段代码:
int count = 1;
while (true)
{
pointOptions.Message = "\nEnter the end point of the line: ";
pointOptions.UseBasePoint = true;
pointOptions.BasePoint = drawnLine.EndPoint;
pointResult = editor.GetPoint(pointOptions);
if (pointResult.Status == PromptStatus.Cancel)
{
break;
}
if (count == 1)
{
drawnLine.AddVertexAt(count, pointResult.Value.Convert2d(new Plane()), 0, 0, 0);
blockTableRecord.AppendEntity(drawnLine);
transaction.AddNewlyCreatedDBObject(drawnLine, true);
}
else
{
stretch(drawnLine, pointResult.Value, Point3d.Origin);
}
editor.Regen();
count++;
}
代码工作正常,但要完成绘图我必须输入 ESC,我想右键单击或空格键单击以关闭我的循环。我可以这样做吗?