This one works too, by taking out the upgradeOpen() and using AcDb::kForWrite
I see you are using cast(), what is the benefit on that Alex ?
Thanks!
static void LESQsomefunctions_ADDROW(void)
{
ads_name ename;
ads_point ptres;
if ( acedEntSel( "\nSelect TABLE:", ename, ptres ) == RTNORM ) {
AcDbTable *pTable = NULL;
AcDbObjectId entId;
acdbGetObjectId( entId, ename );
acdbTransactionManager->startTransaction();
if ( acdbTransactionManager->getObject(
( AcDbObject*& )pTable, entId, AcDb::kForWrite) == Acad::eOk) {
if ( pTable->isKindOf( AcDbTable::desc() ) ) {
if (( pTable->insertRows( pTable->numRows(),
pTable->rowHeight( 1 ) ) == Acad::eOk ) &&
( pTable->generateLayout() == Acad::eOk )) {
acutPrintf( "\nAdded one row and table updated." );
} else {
acutPrintf( "\nTable not updated." );
}
}// end of is AcDbTable
}// end of getObject
acdbTransactionManager->endTransaction();
}// end of acedEntSel
}