- 积分
- 385
- 明经币
- 个
- 注册时间
- 2004-7-19
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
这是我自定义的一个实体类:
class AsdkEllipseJig : public AcEdJig
{ public: AsdkEllipseJig(const AcGePoint3d&, const AcGeVector3d&); void doIt(); virtual DragStatus sampler(); virtual Adesk::Boolean update(); virtual AcDbEntity* entity() const;
private: AcDbEllipse *mpEllipse; AcGePoint3d mCenterPt, mAxisPt; AcGeVector3d mMajorAxis, mNormal; double mRadiusRatio; int mPromptCounter; };
用下面的这个实体插入数据库记录的代码:
AsdkMyClass * pclass= new AsdkMyClass(12);//,startPt,endPt); pclass->setData(50); AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close();
AcDbObjectId classId; pBlockTableRecord->appendAcDbEntity(classId, pclass);
pBlockTableRecord->close(); pclass->close(); 可执行到 pBlockTableRecord->appendAcDbEntity(classId, pclass);就出错,谁能告诉为什么吗,错在哪儿了?小弟谢谢啦! |
|