//
// ObjectARX defined commands, created by [2010-9-30], ,
#include "StdAfx.h"
#include "StdArx.h"
#include "dbents.h"
#include "geassign.h"
#include "dbpl.h"
蒸馏水发生器
#define PI 3.141592653589793238462643383279502884197169399375105820974944592308
BOOL AddEntityToDBS(AcDbEntity *pEntity, AcDbObjectId &Id)
{
//获取块表
AcDbBlockTable *pBlockTable = NULL;
if (acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead) != Acad::eOk)
{
return FALSE;
}
AcDbBlockTableRecord *pBlkTabRec = NULL;android游戏引擎
if (pBlockTable->getAt(ACDB_MODEL_SPACE, pBlkTabRec, AcDb::kForWrite) != Acad::eOk)
{
pBlockTable->close();
return FALSE;
}
pBlkTabRec->appendAcDbEntity(Id, pEntity);
pEntity->close();
pBlockTable->close();
pBlkTabRec->close();
return TRUE;
}
//-----------绘制直线----------------------------------------------------- // This is command 'CLINE, by [2010-9-30], ,
void EICADDrawCLine()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - EICADDrawCLine() called.");
#endif // OARXWIZDEBUG
// TODO: Implement the command
ads_point pt0;
ads_point pt;
AcDbObjectId EntId;
if (ads_getpoint(NULL, _T("\n请指定起始点:"), pt0) !=RTNORM) return;
if (ads_getpoint(pt0, _T("\n请指定终点:"), pt) != RTNORM) return;
AcDbLine *pLine = new AcDbLine(asPnt3d(pt0), asPnt3d(pt));
AddEntityToDBS(pLine, EntId);
pLine->close();
}
//-----------编辑直线起点-----------------------------------------------------
// This is command 'EDITLSTARTPOINT, by [2010-9-30], ,
void EICADDRAWEditlstartpoint()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - EICADDRAWEditlstartpoint() called.");
#endif // OARXWIZDEBUG
// TODO: Implement the command
ads_point pt0;
ads_point pt;
ads_name Ent;
能源智能控制 AcDbObjectId EntId;
AcDbLine *pLine = NULL;
三七的花怎样制成干茶
if (ads_entsel(_T("\n请选择对象:"), Ent, pt0) != RTNORM) return;
if (ads_getpoint(NULL, _T("\n请选择起点:"), pt) != RTNORM) return;
if (acdbGetObjectId(EntId, Ent) != Acad::eOk) return;
if (acdbOpenObject(pLine, EntId, AcDb::kForWrite) != Acad::eOk) return;
pLine->setStartPoint(asPnt3d(pt));
pLine->close();
}
//------------编辑直线终点------------------------------------------------------
// This is command 'EDITLENDPOINT, by [2010-9-30], ,
void EICADDRAWeditlendpoint()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - EICADDRAWeditlendpoint() called.");
#endif // OARXWIZDEBUG亿万像素
// TODO: Implement the command
ads_point pt0;
ads_point pt;
ads_name Ent;
AcDbObjectId EntId;
AcDbLine *pLine = NULL;
if (ads_entsel(_T("\n请选择对象:"), Ent, pt0) != RTNORM) return;
if (ads_getpoint(NULL, _T("\n请选择终点:"), pt) != RTNORM) return;
if (acdbGetObjectId(EntId, Ent) != Acad::eOk) return;
if (acdbOpenObject(pLine, EntId, AcDb::kForWrite) != Acad::eOk) return;
pLine->setEndPoint(asPnt3d(pt));
pLine->close();
}
//----------绘制多段线------------------------------------------------------
// This is command 'CPLINE, by [2010-9-30], ,
void EICADDRAWCPLine()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - EICADDRAWCPLine() called.");
#endif // OARXWIZDEBUG
// TODO: Implement the command
ads_point pt0 = {0.0};
ads_point pt = {0.0};
AcDbObjectId EntId;
AcGePoint2d Gpt2d;
AcDbPolyline *pPLine = new AcDbPolyline();
if (ads_getpoint(NULL, _T("\n请指定起始点:"), pt0) != RTNORM) return;
Gpt2d.set(pt0[X], pt0[Y]);
if (pPLine->addVertexAt(0, Gpt2d) != Acad::eOk)
{
delete pPLine;
return;
}
AddEntityToDBS(pPLine, EntId);
pPLine = NULL;
while (ads_getpoint(pt0, _T("\n请指定下一个点:"), pt) == RTNORM)
{
Gpt2d.set(pt[X], pt[Y]);
pt0[X] = pt[X];
pt0[Y] = pt[Y];
if (acdbOpenObject(pPLine, EntId, AcDb::kForWrite) != Acad::eOk) return;
if (pPLine->addVertexAt(pPLine->numVerts(), Gpt2d) != Acad::eOk)
{
编织袋颗粒 return;
}
pPLine->close();
}
AddEntityToDBS(pPLine, EntId);
pPLine->close();
}
//-------------绘制圆(用户输入圆心和半径画圆)----------------------------------------------------- // This is command 'CCIRCLE, by [2010-9-30], ,
void EICADDrawCCircle()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - EICADDrawCCircle() called.");
#endif // OARXWIZDEBUG
// TODO: Implement the command
ads_point pt;
ads_real pr;
AcDbObjectId EntId;
if (ads_getpoint(NULL, _T("\n请指定圆心:"), pt) != RTNORM) return;
if (ads_getreal(_T("\n请输入半径:"), &pr) != RTNORM) return;
AcDbCircle *pCircle = new AcDbCircle(asPnt3d(pt), AcGeVector3d(0.0, 0.0, 1.0), pr);
pCircle->setColorIndex(4);