求助
各位大侠:<BR> 你们好。<BR>我是一个初学者。请教下面这几个问题:<BR>void DrawLine()<BR>{<BR> AcGePoint3d startPoint(5.0,4.0,0.0);<BR> AcGePoint3d endPoint(15.0,10.0,0.0);<BR> AcDbLine *PLine= new AcDbLine(startPoint,endPoint);<BR> PLine->close();<BR>}<BR>为什么这个函数创建的线不能显示出来。<BR>2。怎样获取屏幕上的一个点<BR>通常有函数:ads_getPoint();<BR> AcedGetPoint(); <BR>可是怎么获取不了。 谢谢。回复
参考:创建line:
AcDbObjectId createLine()<BR>{<BR> AcDbDatabase *pCurDb;<BR> pCurDb = acdbHostApplicationServices()->workingDatabase();
AcGePoint3d startPt(4.0,2.0,0.0);<BR> AcGePoint3d endPt(10.0,7.0,0.0);<BR> AcDbLine *pLine = new AcDbLine(startPt,endPt);
AcDbBlockTable *pBlockTable;<BR> pCurDb->getBlockTable(pBlockTable,AcDb::kForRead);<BR> AcDbBlockTableRecord *pBlockTableRecord;<BR> pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,AcDb::kForWrite);<BR> pBlockTable->close();
AcDbObjectId lineId;<BR> pBlockTableRecord->appendAcDbEntity(lineId,pLine);<BR> pBlockTableRecord->close();<BR> pLine->close();<BR> return lineId;<BR>} 1.你没有加入模型空间
2.问题不明 谢谢。 创建的实体只有加入到数据库中才会显示!注意一点,别忘记关闭实体,否则也不会显示的。<BR>通过 AcedGetPoint()是得到一个点,它是ads_point类型,再转化成acgePoint3d类型,要在屏幕上显示这个点,你必须在通过画点才看到 acedgetpoint()不是画点命令 明白!
谢谢!!!!!!
页:
[1]