- UID
- 2299
- 积分
- 465
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-31
- 最后登录
- 1970-1-1
|
发表于 2003-8-15 21:05:34
|
显示全部楼层
兄弟,我刚才在R15下测试了一下,可以啊。没有用BeginEditorCommand()等等
你是如何取X轴或者Y轴的转角?
- // TestDlg.h
- #if !defined(AFX_TESTDLG_H__FB118CF7_17FF_44DB_B58A_1F4917D2A1A2__INCLUDED_)
- #define AFX_TESTDLG_H__FB118CF7_17FF_44DB_B58A_1F4917D2A1A2__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // TestDlg.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CTestDlg dialog
- class CTestDlg : public CDialog //派生自CDialog, 不是CAcUiDialog/CAdUiDialog
- {
- // Construction
- public:
- CTestDlg(CWnd* pParent = NULL); // standard constructor
- // Dialog Data
- //{{AFX_DATA(CTestDlg)
- enum { IDD = IDD_DIALOG1 };
- CString m_strPoint;
- //}}AFX_DATA
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTestDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- // Generated message map functions
- //{{AFX_MSG(CTestDlg)
- afx_msg void OnButton1();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_TESTDLG_H__FB118CF7_17FF_44DB_B58A_1F4917D2A1A2__INCLUDED_)
复制代码
- // TestDlg.cpp : implementation file
- //
- #include "StdAfx.h"
- #include "resource.h"
- #include "TestDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CTestDlg dialog
- CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CTestDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CTestDlg)
- m_strPoint = _T("");
- //}}AFX_DATA_INIT
- }
- void CTestDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTestDlg)
- DDX_Text(pDX, IDC_EDIT1, m_strPoint);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
- //{{AFX_MSG_MAP(CTestDlg)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CTestDlg message handlers
- void CTestDlg::OnButton1()
- {
- // TODO: Add your control notification handler code here
- //ShowWindow(SW_HIDE);
- GetParent()->EnableWindow(TRUE);
- ShowWindow(SW_HIDE);
- GetParent()->SetFocus();
- ads_point pt;
- // Get a point
- int rt = acedGetPoint(NULL, "\nPick a point: ", pt);
- GetParent()->EnableWindow(TRUE);
- ShowWindow(SW_SHOW);
- SetFocus();
- GetParent()->EnableWindow(FALSE);
- EnableWindow(TRUE);
- if (rt == RTNORM) {
- m_strPoint.Format("X: %g , Y: %g , Z: %g", pt[X], pt[Y], pt[Z]);
- UpdateData(FALSE);
- }
- }
复制代码
- // TestCommands.CPP
- // ObjectARX defined commands, created by Rave [2003-8-15], GIS, WillingTime co.
- #include "StdAfx.h"
- #include "StdArx.h"
- #include "resource.h"
- #include "testdlg.h"
- //-----------------------------------------------------------------------------
- // This is command 'TEST, by Rave [2003-8-15], GIS, WillingTime co.
- void _RV_test()
- {
- #ifdef OARXWIZDEBUG
- acutPrintf ("\nOARXWIZDEBUG - _RV_test() called.");
- #endif // OARXWIZDEBUG
- // TODO: Implement the command
- CAcModuleResourceOverride resOverride;
- CTestDlg dlg(acedGetAcadFrame());
- dlg.DoModal();
- }
复制代码 |
|