Beispiel #1
0
        private BCOM.CellElement GroupGeoTagCell(string strCellName)
        {
            BCOM.CellElement oCel = null;

            try
            {
                AddInMain.ComApp.CadInputQueue.SendCommand("GROUP SELECTION");

                //WS: can I use this .NET version of keyin instead of COM based as above?
                //Bentley.Internal.MicroStation.Session.Instance.Keyin("GROUP SELECTION");

                BCOM.ElementEnumerator oEnum = AddInMain.ComApp.ActiveModelReference.GetSelectedElements();

                while (oEnum.MoveNext())
                {
                    if (oEnum.Current.IsCellElement())
                    {
                        oCel = oEnum.Current.AsCellElement();
                        break;
                    }
                }

                oCel.Name = strCellName;

                oCel.Redraw();
                oCel.Rewrite();
            }
            catch
            {
            }

            return(oCel);
        }