Undo begin, Undo End

Undo begin, Undo End

majklha
Advocate Advocate
359 Views
0 Replies
Message 1 of 1

Undo begin, Undo End

majklha
Advocate
Advocate

How to set in Arx begin and end of Undo command. I have (in Acad 2020) this code....

 

//ssget......
acDocManagerPtr()->lockDocument(acDocManagerPtr()->curDocument());
AcTransaction* pTrans = acDocManagerPtr()->curDocument()->transactionManager()->startTransaction();
for (i = 0; i < dl; i++)
{
	acedSSName(sset, i, entita);
	AcDbObjectId idEnt;
	acdbGetObjectId(idEnt, entita);
	Acad::ErrorStatus es;
	if ((es = pTrans->getObject(pObject, idEnt, AcDb::kForWrite)) == Acad::eOk)
        {
	   AcDbEntity *pEnt = AcDbEntity::cast(pObject);
	   pEnt->setLayer(m_idLay, true, true);
	   pEnt->close();
	}
}
Acad::ErrorStatus es = actrTransactionManager->endTransaction(); 
acDocManagerPtr()->unlockDocument(acDocManagerPtr()->curDocument());

for changing of the layer of the enity. And if I change entity to one layer and next to other layer and then use UNDO in Acad, the undo broke more then one command.

In Autolisp is commands (undo begin) a (undo end)...

Thanks for help,

 

Majkl

0 Likes
360 Views
0 Replies
Replies (0)