示例#1
0
        private void cmdGridAdd_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            BaseObjs.acadActivate();

            ObjectId idLineX   = Stake_Grid.addToGroup();
            string   nameLayer = idLineX.getLayer();

            int    i    = nameLayer.IndexOf("GRID");
            string name = nameLayer.Substring(i);

            ResultBuffer rb = idLineX.getXData("GRID");

            if (rb == null)
            {
                return;
            }
            TypedValue[] tvs    = rb.AsArray();
            int          result = 0;
            string       typ    = "";

            if (tvs[1].Value.ToString().isInteger(out result))
            {
                GRIDNUMERIC.Add(idLineX.getHandle());
                typ = "NUMERIC";
            }
            else
            {
                GRIDALPHA.Add(idLineX.getHandle());
                typ = "ALPHA";
            }

            Stake_Dict.updateDictGRIDs(name, typ, "ADD", idLineX, idLineX.getHandle().ToString());
        }
示例#2
0
        private void cmdGetNumeric_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            BaseObjs.acadActivate();
            Entity  ent         = null;
            Point3d pnt3dPicked = Pub.pnt3dO;

            try
            {
                string msg = string.Format("\nSelect the {0}1{1} grid line:\n", 34.asciiToString(), 34.asciiToString());
                ent = Base_Tools45.Select.selectEntity(typeof(Line), msg, "", out pnt3dPicked);
                if (ent == null)
                {
                    return;
                }
            }
            catch (System.Exception)
            {
                return;
            }

            Line  objGridNumeric1 = (Line)ent;
            Color color           = new Color();

            color = Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByBlock, 3);
            objGridNumeric1.ObjectId.changeProp(LineWeight.ByLayer, color);

            GRIDNUMERIC.Add(objGridNumeric1.Handle);
            int i = objGridNumeric1.Layer.IndexOf("GRID");

            string strName = objGridNumeric1.Layer.Substring(i);

            Stake_Grid.setupGrid(objGridNumeric1.ObjectId, strName, "NUMERIC");

            Stake_Dict.updateDictGRIDsWithBldgName(GRIDNUMERIC, strName, "NUMERIC");
        }