コード例 #1
0
        /// <summary>
        /// User selected the plugin, so execute it
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _menuItem_Click(object sender, EventArgs e)
        {
            ShapeCollection selectedShapes = EditorManager.SelectedShapes;

            if (selectedShapes == null || selectedShapes.Count <= 0)
            {
                MessageBox.Show("Please select a shape before you execute this operation");
                return;
            }

            // Move the selected shapes
            foreach (ShapeBase shape in selectedShapes)
            {
                Shape3D shape3d = shape as Shape3D;
                if (shape3d == null || !shape3d.Modifiable)
                {
                    continue;
                }
                IAction customAction = new MoveShapeXAction(shape3d, 30);
                EditorManager.Actions.Add(customAction);
                MessageBox.Show("Shape " + shape3d.ShapeName + " has been moved. You can undo this operation");
                return;
            }
        }
コード例 #2
0
        /// <summary>
        /// User selected the plugin, so execute it
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _menuItem_Click(object sender, EventArgs e)
        {
            ShapeCollection selectedShapes = EditorManager.SelectedShapes;
              if (selectedShapes == null || selectedShapes.Count <= 0)
              {
            MessageBox.Show("Please select a shape before you execute this operation");
            return;
              }

              // Move the selected shapes
              foreach (ShapeBase shape in selectedShapes)
              {
            Shape3D shape3d = shape as Shape3D;
            if (shape3d == null || !shape3d.Modifiable)
             continue;
            IAction customAction = new MoveShapeXAction(shape3d, 30);
            EditorManager.Actions.Add(customAction);
            MessageBox.Show("Shape " + shape3d.ShapeName + " has been moved. You can undo this operation");
            return;
              }
        }