按表走呵呵!(延时死循环)
static void zffObjectARX_MyCommand6(void)
{
AcDbObjectId secondId;
AcDbObjectId minutId;
AcDbObjectId HourId;
AcDbEntity* pSecond=NULL;
AcDbEntity* pMinute=NULL;
AcDbEntity* pHour=NULL;
AcDbHandle haSecond(_T("209"));
AcDbHandle haMinut(_T("1FC"));
AcDbHandle haHour(_T("1FB"));
AcDbDatabase* pDb=acdbHostApplicationServices()->workingDatabase();
pDb->getAcDbObjectId(secondId,false,haSecond);
pDb->getAcDbObjectId(minutId,false,haMinut);
pDb->getAcDbObjectId(HourId,false,haHour);
double ang=pi()/30;
AcGeMatrix3d rotate,minut,hour;
rotate.setToRotation(-ang,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
minut.setToRotation(-ang/60,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
hour.setToRotation(-ang/720,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
while (1)
{
clock_t start=clock();
clock_t time=CLOCKS_PER_SEC;
while (clock()-start<time)
;
acdbOpenObject(pSecond,secondId,AcDb::kForWrite);
acdbOpenObject(pMinute,minutId,AcDb::kForWrite);
acdbOpenObject(pHour,HourId,AcDb::kForWrite);
pSecond->transformBy(rotate);
pMinute->transformBy(minut);
pHour->transformBy(hour);
pSecond->close();
pMinute->close();
pHour->close();
pSecond=NULL;
pMinute=NULL;
pHour=NULL;
actrTransactionManager->queueForGraphicsFlush();
actrTransactionManager->flushGraphics();
acedUpdateDisplay();
}
}
更多文章
-
用AcedGrRead()函数实现一拖多
实现代码:#include "StdAfx.h"#include "StdArx.h"#include "..\..\Common\我的类\Arc.h"#include <acedads.h>#include "..\..\Common\Entity\LineUtil.h"#include <geassign.h>#include <dbents.h>#include "..\..\Common\Others\ConvertUtil.h"#in
-
改变多段线区直
代码:#include "StdAfx.h"#include "StdArx.h"#include <dbpl.h>#include "..\..\Common\Others\ConvertUtil.h"#include <geassign.h>#include "..\..\Common\Entity\ArcUtil.h"#include "..\..\Common\Document\DwgDatabaseUtil.h"#include <afxwin.h&
-
获取任意路径Dwg文件内所有块在控件中显示并能选择插入当前模型空间
主对话框CPP内代码:#include "StdAfx.h"#include "resource.h"#include "BlockDialog.h"#include "..\..\Common\我的类\file.h"#include "..\..\Common\Document\DwgDatabaseUtil.h"#include <dbents.h>#include <dbmain.h>#include "..\..\Chapter11
-
多段线动态切割闭合区域
#include "StdAfx.h"#include "StdArx.h"#include <dbpl.h>#include "..\..\Common\Others\ConvertUtil.h"#include "..\..\Common\Document\DwgDatabaseUtil.h"#include <dbents.h>#include <dbregion.h>#include "..\..\Common\Entity\RegionUtil.h"
-
自创实体类从AcDbCurve派生,实现一些类方法并动态绘制
MyCurve.cpp:#include "StdAfx.h"#include "MyCurve.h"#include "actrans.h"#include "aced.h"//-----------------------------------------------------------------------------Adesk::UInt32 CMyCurve::kCurrentVersionNumber =1 ;//----------------------------------------