ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to delete an entity ?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
1160 Views, 2 Replies

How to delete an entity ?

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);

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

doesn't that work?

 

pEnt->erase();

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3
Anonymous
in reply to: Anonymous

It worked ! Thank you very much !

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost