很奇怪的选择集问题.
<p>通过 int rc = ads_ssget(_T("W"), pt1, pt2, NULL, ssname);</p><p>拾取到一个实体后,用pEnt->transformBy将其移出拾取范围,</p><p>然而再次执行ads_ssget(_T("W"), pt1, pt2, NULL, ssname);</p><p>该实体再次被选中,不知道为什么?一直搞不清楚,希望有人能指点迷津啊</p><p><br/></p> int rc = ads_ssget(_T("W"), pt1, pt2, NULL, ssname);if(rc != RTNORM)
{
return;
}
long length;
ads_sslength(ssname, &length);
ads_name entName;
AcDbObjectId oId;
long rejected = 0;
for(int i=0; i<length; i++)
{
rc=ads_ssname(ssname, i, entName);
es=acdbGetObjectId(oId, entName);
AcDbEntity *pEnt ;
es = acdbOpenAcDbEntity( pEnt , oId , AcDb::kForWrite ) ;
AcGeMatrix3d mat ;
AcGeVector3d vec( pt1-pt2 , pt1-pt2 , 0 ) ;
mat.setTranslation( vec) ;
es = pEnt->transformBy( mat ) ;
pEnt->close() ;
}
ads_ssfree(ssname);
rc = ads_ssget(_T("W"), pt1, pt2, NULL, ssname); //前面被移出的实体依旧被选中
ads_sslength(ssname, &length);
if(rc != RTNORM) <p>解决方法:</p><p>在移动完实体后,刷新视图就好了</p><p>actrTransactionManager->flushGraphics(); //刷新视图<br/></p>
页:
[1]