示例#1
0
        private static Xrecord GetValueRecord(this AcTransaction trans, string valName)
        {
            valName = Ac.GetValidName(valName);

            var valDict = trans.GetGeo7Dict("Values");

            if (valDict.Contains(valName))
            {
                var valId = valDict.GetAt(valName);
                return(trans.GetObject <Xrecord>(valId));
            }
            else
            {
                var typedVal = new TypedValue((int)DxfCode.Text, "");
                using (var resBuff = new ResultBuffer(typedVal))
                {
                    var xRec = new Xrecord();
                    xRec.Data = resBuff;
                    valDict.SetAt(valName, xRec);
                    trans.AddNewlyCreatedDBObject(xRec, true);
                    return(xRec);
                }
            }



            //ResultBuffer resbuf = new ResultBuffer(  new TypedValue((int)DxfCode.Text, "HELLO"),
            //     new TypedValue((int)DxfCode.Int16, 256),
            //     new TypedValue((int)DxfCode.Real, 25.4));
        }