- 积分
- 12459
- 明经币
- 个
- 注册时间
- 2003-5-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-10-7 19:07:00
|
显示全部楼层
回复
参考:
void getUcsToWcsMatrix(AcGeMatrix3d& m, AcDbDatabase* db) { ASSERT(db != NULL);
if (!acdbUcsMatrix(m, db)) { m.setToIdentity(); ASSERT(0); } }
void ucsToWcs(AcGePoint3dArray& ptArray) { AcDbDatabase* db = acdbHostApplicationServices()->workingDatabase(); ASSERT(db != NULL);
AcGeMatrix3d m; getUcsToWcsMatrix(m, db);
int len = ptArray.length(); for (int i=0; i<len; i++) ptArray = m * ptArray; }
// ----- asdktest._test command (do not rename) static void asdktest_test(void) { // Add your code for command asdktest._test here int i;
AcDbObjectId lineId; AcDbObjectId ptId; AcGePoint3d Pt;
AcDb3dPolyline *pLine;
AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,AcDb::kForWrite); pBlockTable->close();
AcGeMatrix3d ucsToWcsMat;
acdbUcsMatrix(ucsToWcsMat);
AcGePoint3dArray vertices;
for(i=1;i<=10;i++) { Pt.x=i; Pt.y=i; Pt.z=0.0; vertices.append(Pt); }
pLine = new AcDb3dPolyline(AcDb::k3dSimplePoly, vertices); pLine->setDatabaseDefaults(); pBlockTableRecord->appendAcDbEntity(lineId, pLine); pBlockTableRecord->close(); pLine->close(); }
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|