|
哪位大哥能帮我运行以下这段代码,直接复制上去,一个命令就可以了,我这里老是在程序结束完了,释放 交点的时候 ,就报告说发生冲突,哪位大哥帮帮忙啊,运行一下。
AcDbEntity *ent=NULL;
AcRxClass *cls=AcDbPolyline::desc();
ads_name entName;
ads_point pt;
AcDbPolyline *pl1=NULL;
AcDbPolyline *pl2=NULL;
if(acedEntSel(TEXT("select pl1:\n"),entName,pt)==RTNORM){
AcDbObjectId entId;
ErrorStatus es=acdbGetObjectId(entId,entName);
if(es==ErrorStatus::eOk){
es=acdbOpenObject(pl1,entId,AcDb::kForWrite);
if(es!=ErrorStatus::eOk){
return;
}
}
}
else{
return;
}
if(acedEntSel(TEXT("select pl2:\n"),entName,pt)==RTNORM){
AcDbObjectId entId;
ErrorStatus es=acdbGetObjectId(entId,entName);
if(es==ErrorStatus::eOk){
es=acdbOpenObject(pl2,entId,AcDb::kForWrite);
if(es!=ErrorStatus::eOk){
pl1->close();
return;
}
}
}
else{
pl1->close();
return;
}
AcGePoint3dArray ptArrJ;
ErrorStatus es= pl1->intersectWith(pl2,AcDb::kOnBothOperands,ptArrJ);
acutPrintf(L"%d",es);
if(ptArrJ.length()>=2){
pl1->close();
pl2->close();
}
直接复制在一个方法里就行了
|
|