绘制完线后发送regen还是和原来一样,要关闭两个对话框才能看到直线。 extern Adesk::Boolean acedPostCommand(const char* ); void CLineDlg::OnBUTTONline() { // TODO: Add your control notification handler code here //隐藏对话框把控制权交给AutoCAD BeginEditorCommand(); AcGePoint2d InsrtPt(0, 0); AcGePoint2d Pt1(0, 0); //提示用户输入一点 ads_point pt; if (acedGetPoint(NULL, "\n输入一个点:", pt) == RTNORM) { InsrtPt.set(pt[X], pt[Y]);  t1.set(pt[X]+1000, pt[Y]+1000); CCreateEnt::CreatePolyline(InsrtPt, Pt1, 1); acedPostCommand("regen"); // 如果点有效,继续执行 CompleteEditorCommand(); } else { // 否则取消命令(包括对话框) CancelEditorCommand(); } }
|