apple06 发表于 2005-6-28 07:40:00

[求助]在ARX中如何使用trim和break

我想在ARX中使用trim和break函数,并能捕捉到图元对象的交点,不知该如何操作。望各位高手不惜赐教,最好能上传一个简单的例子,谢谢啦。

apple06 发表于 2005-7-4 14:34:00

好掺,至今仍没有人回答,各位高手拜托了,想想办法帮帮忙吧

nc2t 发表于 2009-2-4 18:02:00

<p>哪位兄弟知道实现方法,请不吝赐教</p>

BDYCAD 发表于 2009-2-6 08:53:00

AcDbBlockTableRecord *GetModelSpace(AcDb::OpenMode Mode){
AcDbDatabase *pDwg = acdbHostApplicationServices()->workingDatabase();
AcDbBlockTable *pBlockTable;
AcDbBlockTableRecord *pModelSpace;
pDwg->getSymbolTable(pBlockTable, AcDb::kForRead);
pBlockTable->getAt(ACDB_MODEL_SPACE, pModelSpace, Mode);
pBlockTable->close();
return pModelSpace;
}
AcDbObjectIdArray BreakEntity(AcDbObjectId ObjId,AcGePoint3d Spt,AcGePoint3d Ept){
double param1,param2;
AcGePoint3d p11,p21;
AcDbEntity *pEnt;
AcDbCurve *pCurve;
AcDbObjectId NobjID;
AcGeDoubleArray params;
AcDbObjectIdArray BreakNewObjID=NULL;
acdbOpenObject(pCurve,ObjId,AcDb::kForWrite);
pCurve->getClosestPointTo(Spt,p11);
pCurve->getClosestPointTo(Ept,p21);
pCurve->getParamAtPoint(p11,param1);
pCurve->getParamAtPoint(p21,param2);
if (param1<param2){
params.append(param1);
params.append(param2);
}else{
params.append(param2);
params.append(param1);
}
AcDbVoidPtrArray curveSegments;
pCurve->getSplitCurves(params, curveSegments);
AcDbBlockTableRecord *pModelSpace=GetModelSpace(AcDb::kForWrite);
for (int i=0;curveSegments.length()>i;i++) {
pEnt=(AcDbEntity*)curveSegments.at(i);
pModelSpace->appendAcDbEntity(NobjID,pEnt);
BreakNewObjID.append(NobjID);
pEnt->close();
}
pModelSpace->close();
pCurve->close();
return BreakNewObjID;
}
页: [1]
查看完整版本: [求助]在ARX中如何使用trim和break