The UCS table object does not have a method for deleting a UCS. Instead, each UCS record object deletes itself.
When the UCS deletes itself, the database marks it as "erased" and the UCS continues to be stored in the UCS table
until the database is not saved in a file. This gives the ability to recover UCSs. Recovery is possible only if
the undo process is begun for the database, otherwise objects are deleted permanently. The pUCSs variable stores
a pointer to the UCS table object. For example, add a UCS in the table:
To start the undo process, use the startUndoRecord() method of the database object. For example:
pUCSs->database()->startUndoRecord();
Deleting a UCS
To delete a UCS, get the smart pointer to the UCS record object in write mode and use the erase() method when its
argument equals True. The erase() method marks the UCS as «erased» and returnsthe result status in the
OdResult value. For example:
pUCS = pUCSs->getAt("UCS1", OdDb::kForWrite);
OdResult result = pUCS->erase(true);
The program can use the obtained result value for verification. For example:
If the UCS record object is not opened in write mode, the erase() method generates the exception:
«62 - Not opened for write».
Recovering a UCS
A UCS marked as «erased» is stored in the database and can be recovered from the UCS table;
the program must start the undo process for the database, otherwise the erase()method deletes the UCS
permanently. To recover a UCS, get the smart pointer to the deleted UCS record object in the write mode and
use the erase() method when its argument equals False. The erase() method marks the UCS
as «unerased». For example: