Undo not work for c# rs. scritp and label justification

I have this code on a button:

var rhinoscript_object = RhinoApp.GetPlugInObject(“RhinoScript”);
var rs = (IRhinoScript)rhinoscript_object;

string a = “example1”;
string b = “example1”;
string c = “example1”;

string label = a + “=” + “x” + b + “x” + c;
var size = rs.AddText(label, centerPoint[0], letra, “Arial”, “131072”);

Here I have two problems ,

1º the text is not obdicion justification, probably something is wrong in my code.

2º whenever some object or command starts from this script, the “UNDO” command on Rhino
does not work, it is as if he had not inserted anything, this is a bug? or is normal?

thanks

solve,

1º I dont know wy but the justification for the text is the code 1,
var size = rs.AddText(label, centerPoint[0], letra, “Arial”, “1”);

2º for the undo function, the BeginUndoRecord and EndUndoRecord is need on the code.

Thanks