zdfwyh 发表于 2005-8-23 12:43:00

如何实现交互对话框(选择一个点)

我想建立一个对话框,上面有一个按钮,点击后隐藏对话框,从CAD中选取一点,然后显示对话框,和坐标.不知如何实现这个交互过程?请高手指点迷津.

yfy2003 发表于 2005-8-23 16:46:00

<P>void AsdkAcUiDialogSample::OnButtonPoint() <BR>{<BR>&nbsp;&nbsp;&nbsp; // Hide the dialog and give control to the editor<BR>&nbsp;&nbsp;&nbsp; BeginEditorCommand();</P>
<P>&nbsp;&nbsp;&nbsp; ads_point pt;</P>
<P>&nbsp;&nbsp;&nbsp; // Get a point<BR>&nbsp;&nbsp;&nbsp; if (acedGetPoint(NULL, "\nPick a point: ", pt) == RTNORM) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If the point is good, continue<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CompleteEditorCommand();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_strXPt.Format("%g", pt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_strYPt.Format("%g", pt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_strZPt.Format("%g", pt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DisplayPoint();<BR>&nbsp;&nbsp;&nbsp; } else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // otherwise cancel the command (including the dialog)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CancelEditorCommand();<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>}</P>
页: [1]
查看完整版本: 如何实现交互对话框(选择一个点)