{
	auto ObjectRec = [](BaseObject *op, BaseDocument *doc) -> void {
		if(!op) return;
		LONG num = 0;
		while(op){
			doc->AddUndo(UNDOTYPE_CHANGE,op);
			op->SetName(op->GetName()+"_"+LongToString(num));
			++num;
			//ObjectRec(op->GetDown(),doc); //do not work with auto lambdas
			op = op->GetNext();
		}
	};

	BaseDocument *doc = GetActiveDocument();
	doc->StartUndo();
	BaseObject *op = doc->GetFirstObject();
	ObjectRec(op,doc);
	doc->EndUndo();
	EventAdd();
}