Пример #1
0
        protected override AcEd.SamplerStatus Sampler(AcEd.JigPrompts prompts)
        {
            System.Windows.Forms.Keys mods = System.Windows.Forms.Control.ModifierKeys;
            if ((mods & System.Windows.Forms.Keys.Control) > 0)
            {
                AcEd.JigPromptAngleOptions jpao = new AcEd.JigPromptAngleOptions("\nВкажіть обертання: ")
                {
                    UseBasePoint      = true,
                    BasePoint         = blockReference.Position,
                    Cursor            = AcEd.CursorType.RubberBand,
                    UserInputControls = (AcEd.UserInputControls.Accept3dCoordinates /*|
                                                                                     * UserInputControls.UseBasePointElevation*/)
                };
                AcEd.PromptDoubleResult pdr = prompts.AcquireAngle(jpao);

                if (rotation == pdr.Value)
                {
                    return(AcEd.SamplerStatus.NoChange);
                }
                else
                {
                    rotation = pdr.Value;
                    return(AcEd.SamplerStatus.OK);
                }
            }
            else
            {
                AcEd.JigPromptPointOptions jppo =
                    new AcEd.JigPromptPointOptions("\nВкажіть точку вставки (або натисніть 'Ctrl' для  обертання): ")
                {
                    UserInputControls = (AcEd.UserInputControls.Accept3dCoordinates | AcEd.UserInputControls.NullResponseAccepted)
                };
                AcEd.PromptPointResult ppr = prompts.AcquirePoint(jppo);
                if (position.DistanceTo(ppr.Value) < AcGe.Tolerance.Global.EqualPoint)
                {
                    return(AcEd.SamplerStatus.NoChange);
                }
                else
                {
                    position = ppr.Value;
                }
                return(AcEd.SamplerStatus.OK);
            }
        }
Пример #2
0
        protected override AcEd.SamplerStatus Sampler(AcEd.JigPrompts prompts)
        {
            System.Windows.Forms.Keys mods = System.Windows.Forms.Control.ModifierKeys;
            if ((mods & System.Windows.Forms.Keys.Control) > 0)
            {
                AcEd.JigPromptAngleOptions jpao =
                    new AcEd.JigPromptAngleOptions("\nSpecify the rotation: ");
                jpao.UseBasePoint      = true;
                jpao.BasePoint         = _br.Position;
                jpao.Cursor            = AcEd.CursorType.RubberBand;
                jpao.UserInputControls = (
                    AcEd.UserInputControls.Accept3dCoordinates /*|
                                                                * AcEd.UserInputControls.UseBasePointElevation*/);
                AcEd.PromptDoubleResult pdr = prompts.AcquireAngle(jpao);

                if (_rot == pdr.Value)
                {
                    return(AcEd.SamplerStatus.NoChange);
                }
                else
                {
                    _rot = pdr.Value;
                    return(AcEd.SamplerStatus.OK);
                }
            }
            else
            {
                AcEd.JigPromptPointOptions jppo =
                    new AcEd.JigPromptPointOptions("\nSpecify insertion point (or press Ctrl for rotation): ");
                jppo.UserInputControls =
                    (AcEd.UserInputControls.Accept3dCoordinates | AcEd.UserInputControls.NullResponseAccepted);
                AcEd.PromptPointResult ppr = prompts.AcquirePoint(jppo);
                if (_pos.DistanceTo(ppr.Value) < AcGe.Tolerance.Global.EqualPoint)
                {
                    return(AcEd.SamplerStatus.NoChange);
                }
                else
                {
                    _pos = ppr.Value;
                }
                return(AcEd.SamplerStatus.OK);
            }
        }