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()); }
private void cmdGetAlpha_Click(System.Object eventSender, System.EventArgs eventArgs) { BaseObjs.acadActivate(); Entity ent = null; Point3d pnt3dPicked = Pub.pnt3dO; try { string msg = string.Format("\nSelect the {0}A{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 objGridAlphaA = (Line)ent; Color color = new Color(); color = Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByBlock, 6); objGridAlphaA.ObjectId.changeProp(LineWeight.ByLayer, color); GRIDALPHA.Add(objGridAlphaA.Handle); int i = objGridAlphaA.Layer.IndexOf("GRID"); string strName = objGridAlphaA.Layer.Substring(i); Stake_Grid.setupGrid(objGridAlphaA.ObjectId, strName, "ALPHA"); Stake_Dict.updateDictGRIDsWithBldgName(GRIDALPHA, strName, "ALPHA"); }