I have some problems with using user dictionary, I was searching for possible causes all over the forum, but without success.
I think, that problem might be related with this one:

And the problem is, that I can’t write surface with user dictionary, this is the code:

public Result Build1stOrderQuadAsSurfaces(List gcoords, MyGelmnt1 element, MyGelref1 gelref1, RhinoDoc doc)
var defaultAttr = new ObjectAttributes();
defaultAttr.ObjectColor = Color.Green;
defaultAttr.ColorSource = ObjectColorSource.ColorFromObject;

        Point3dList point3dList = new Point3dList();

        point3dList.Insert(0, P3d(gcoords, element.Nodin[0]));
        point3dList.Insert(1, P3d(gcoords, element.Nodin[1]));
        point3dList.Insert(2, P3d(gcoords, element.Nodin[3]));
        point3dList.Insert(3, P3d(gcoords, element.Nodin[2]));

        int count = (int)Math.Sqrt(point3dList.Count);

        var srf = NurbsSurface.CreateFromPoints(point3dList, count, count, 1, 1);

        srf.UserDictionary.Set("Elno", gelref1.Elno.ToString());
        srf.UserDictionary.Set("Matno", gelref1.Matno.ToString());
        srf.UserDictionary.Set("Addno", gelref1.Addno.ToString());
        srf.UserDictionary.Set("Intno", gelref1.Intno.ToString());
        srf.UserDictionary.Set("Mintno", gelref1.Mintno.ToString());
        srf.UserDictionary.Set("Strano", gelref1.Strano.ToString());
        srf.UserDictionary.Set("Streno", gelref1.Streno.ToString());
        srf.UserDictionary.Set("Strepono", 0);
        srf.UserDictionary.Set("GeonoOpt", gelref1.GeonoOpt.ToString());
        srf.UserDictionary.Set("FixnoOpt", gelref1.FixnoOpt.ToString());
        srf.UserDictionary.Set("EccnoOpt", gelref1.EccnoOpt.ToString());
        srf.UserDictionary.Set("TransnoOpt", gelref1.TransnoOpt.ToString());

        if (doc.Objects.AddSurface(srf, defaultAttr) != Guid.Empty)
            return Result.Success;

        return Result.Failure;

This part, doesn’t show any properties applied to surface:

    protected override Rhino.Commands.Result RunCommand(RhinoDoc doc, Rhino.Commands.RunMode mode)
        Rhino.DocObjects.ObjRef objref;
        var rc = Rhino.Input.RhinoGet.GetOneObject("Select Face", false, Rhino.DocObjects.ObjectType.Surface, out objref);
        if (rc != Rhino.Commands.Result.Success)
            return rc;

        GeometryBase srf = objref.Surface();

        if (srf.UserDictionary.ContainsKey("Elno"))
            RhinoApp.WriteLine("{0} = {1}", "Element number ", srf.UserDictionary["Elno"].ToString());

        return Rhino.Commands.Result.Success;

can you please help?

I think the problem is that you add the information to the NurbsSurface object. When you select the face, you get a BrepFace back. What you should do is add the surface to the document as a Brep and set the values on the Brep’s UserDictionary.

NurbsSurface srf = NurbsSurface.CreateFromPoints(point3dList, count, count, 1,1);
Brep b = srf.ToBrep();
b.SetUserDictionary("Elno", gelref1.Elno.ToString());
// and all the other properties

Followed by

ObjRef objRef;
var rc = Rhino.Input.RhinoGet.GetOneObject("Select Face", false, Rhino.DocObjects.ObjectType.Brep, out objref);
        if (rc != Rhino.Commands.Result.Success)
            return rc;
Brep b = objRef.Brep();
if (b.UserDictionary.ContainsKey("Elno"))
    RhinoApp.WriteLine("{0} = {1}", "Element number ", srf.UserDictionary["Elno"].ToString());