I'm trying to make a command that allow user to select multi object, then delete them. However, while i success in select them as an Entity, i can not find any command to delete them. No delete/remove command at all. Anyone know how can i delete them ?
Here is my code :
//select object
ads_name pName;
acedSSGet(NULL,NULL,NULL,NULL,pName);
// get the total number of object
long number = 0;
if ((acedSSLength( pName, &number ) != RTNORM) || (number == 0))
{
acedSSFree( pName );
}
ads_name ent;
AcDbObjectId id = AcDbObjectId::kNull;
// Open to delete
for (long i = 0; i < number; i++) {
acedSSName(pName,i,ent) != RTNORM ;
acdbGetObjectId(id,ent);
AcDbEntity* pEnt = NULL;
acdbOpenAcDbEntity(pEnt,id,AcDb::kForWrite);
// delete command ...
//
pEnt->close();
}
acedSSFree(pName);
Solved! Go to Solution.
Solved by Alfred.NESWADBA. Go to Solution.
Hi,
doesn't that work?
pEnt->erase();
- alfred -