- UID
- 222448
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-3-5
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2005-3-28 10:27:38
|
显示全部楼层
我也知道是一样的/
但是还是有问题。
贴出原代码看看/
// msf.cpp : implementation file
//
#include "StdAfx.h"
#include "resource.h"
#include "msf.h"
#include <math.h>
#include "StdAfx.h"
#include "dbapserv.h"
#include "geassign.h "
#include "dbents.h"
#include "migrtion.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
static const double PI=3.14159265358979;
extern HWND adsw_acadMainWnd();
extern "C" HINSTANCE _hdllInstance;
static HWND hWndACAD = NULL;
extern "C" BOOL APIENTRY DllMain(HINSTANCE, DWORD, LPVOID);
double ry(double a,double r,double n);
double rx(double a,double r,double n); //求内移外移
double yy(double a,double r,double n);
double xx(double a,double r,double n); //求XY
double yyy(double a,double r,double n);
double xxx(double a,double r,double n); //求XY/100
double xxu(double xx0,double k,double r);
//double xxd(double xx1,double k,double r);
double yyu(double yy0,double k,double r);
//double yyd(double yy1,double k,double r);
//double re(double k);
double tts(double x0,double y0,double x1,double y1,double l0,double l1);
double ttn(double x0,double y0,double x1,double y1,double l0,double l1);
void makeLine(AcGePoint3d st,AcGePoint3d et);
void makeLine(double x1,double y1,double z1,double x2,double y2,double z2);
void makeCircle(double x1,double y1,double z1,double radius);
void makeLineC(double x1,double y1,double z1,double x2,double y2,double z2, Adesk::UInt16 newColor);
void makeCircleC(double x1,double y1,double z1,double radius, Adesk::UInt16 newColor);
AcDbObject* selectObject(char* selePrompt,char* pHandle,AcDb::OpenMode openMode,AcGePoint3d &pnt3d);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// msf dialog
msf::msf(CWnd* pParent /*=NULL*/)
: CDialog(msf::IDD, pParent)
{
//{{AFX_DATA_INIT(msf)
m_yy = 0.0;
//}}AFX_DATA_INIT
}
void msf::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(msf)
DDX_Text(pDX, IDC_EDIT2, m_yy);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(msf, CDialog)
//{{AFX_MSG_MAP(msf)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// msf message handlers
void msf::OnButton1() //选一实体直线,赋起点终点坐标/
{
// TODO: Add your control notification handler code here
// TODO: Add your control notification handler code here
EndDialog(IDC_BUTTON1);
// TODO: Add your control notification handler code here
AcDbObject *pObj2;
AcGePoint3d pickPoint2,st,ed;
if ((pObj2 = selectObject("\n请选择一条直线:",NULL,AcDb::kForRead,pickPoint2)) == NULL)
{return ;}
if(!(pObj2->isKindOf(AcDbLine::desc())))
{return ;}
//if ((pObj1 = selectObject("请选择第一条直线:",NULL,AcDb::kForRead,pickPoint1)) != NULL)
else
{
AcDbLine *pLine2=(AcDbLine*)pObj2;
st=pLine2->startPoint();
ed=pLine2->endPoint();
//acutPrintf(st[X],st[Y],st[Z],ed[X],ed[Y],ed[Z]);
acutPrintf("\n(%0.4f,%0.4f,%0.4f)"//此处没有逗号
" ""(%0.4f,%0.4f,%0.4f)",
st[X],st[Y],st[Z],
ed[X],ed[Y],ed[Z]);
lsx0=st[X];lsy0=st[Y];
lex1=ed[X];ley1=ed[Y];
acutPrintf("\n(%0.3f,%0.3f,%0.3f)"//此处没有逗号
" ""(%0.3f,%0.3f,%0.3f)",
lsx0,lsy0,st[Z],
lex1,ley1,ed[Z]);
}
msf msf(CWnd::FromHandle(hWndACAD));
msf.DoModal();
}
void msf::OnButton2() //选一实体园,赋圆心坐标和半径
{
// TODO: Add your control notification handler code here
// TODO: Add your control notification handler code here
EndDialog(IDC_BUTTON2);
// TODO: Add your control notification handler code here
AcDbObject *pObj3;
AcGePoint3d pickPoint3,ce;
double r;
if ((pObj3 = selectObject("\n请选择一个圆:",NULL,AcDb::kForRead,pickPoint3)) == NULL)
{return ;}
if(!(pObj3->isKindOf(AcDbCircle::desc())))
{return ;}
//if ((pObj1 = selectObject("请选择第一条直线:",NULL,AcDb::kForRead,pickPoint1)) != NULL)
else
{
AcDbCircle *pCir3=(AcDbCircle*)pObj3;
ce=pCir3->center();
r=pCir3->radius();
//acutPrintf(st[X],st[Y],st[Z],ed[X],ed[Y],ed[Z]);
acutPrintf("\n(%0.4f,%0.4f,%0.f)"//此处没有逗号
"\n(%0.3f)",
ce[X],ce[Y],ce[Z],
r);
cx2=ce[X];cy2=ce[Y];
rr1=r;
acutPrintf("\n(%0.4f,%0.4f,%0.f)"//此处没有逗号
"\n(%0.3f)",
cx2,cy2,ce[Z],
rr1);
/* m_lsx0 =lsx0;
UpdateData(false);
m_lsy0 =lsy0;
UpdateData(false);
m_lex1 =lex1;
UpdateData(false);
m_ley1 =ley1;
UpdateData(false);
m_yy=lsy0;
UpdateData(false);*/
}
msf msf(CWnd::FromHandle(hWndACAD));
msf.DoModal();
}
void msf::OnButton3() //选择一个实体园,赋radius给rr2
{
// TODO: Add your control notification handler code here
EndDialog(IDC_BUTTON3);
// TODO: Add your control notification handler code here
AcDbObject *pObj4;
AcGePoint3d pickPoint4,ce;
double r;
if ((pObj4 = selectObject("\n请选择一个圆:",NULL,AcDb::kForRead,pickPoint4)) == NULL)
{return ;}
if(!(pObj4->isKindOf(AcDbCircle::desc())))
{return ;}
//if ((pObj1 = selectObject("请选择第一条直线:",NULL,AcDb::kForRead,pickPoint1)) != NULL)
else
{
AcDbCircle *pCir4=(AcDbCircle*)pObj4;
ce=pCir4->center();
r=pCir4->radius();
//acutPrintf(st[X],st[Y],st[Z],ed[X],ed[Y],ed[Z]);
acutPrintf("\n(%0.4f,%0.4f,%0.f)"//此处没有逗号
"\n(%0.3f)",
ce[X],ce[Y],ce[Z],
r);
rr2=r;
acutPrintf("\n(%0.4f,%0.4f,%0.f)"//此处没有逗号
"\n(%0.3f)",
ce[X],ce[Y],ce[Z],
rr2);
/* m_cx2 =cx2;
UpdateData(false);
m_cy2 =cy2;
UpdateData(false);
m_rr1 =rr1;
UpdateData(false);
m_rr2 =rr2;
UpdateData(false);
*/
}
msf msf(CWnd::FromHandle(hWndACAD));
msf.DoModal();
}
void msf::OnButton4()
{
// TODO: Add your control notification handler code here
}
void msf::OnButton5() //我在这里调用却给不出我选的实体的一些值??????????????/
{
// TODO: Add your control notification handler code here
m_yy=rr1;
UpdateData(false);
} |
|