コード例 #1
0
        protected override AcEd.SamplerStatus Sampler(AcEd.JigPrompts jp)
        {
            AcEd.JigPromptPointOptions po = new AcEd.JigPromptPointOptions("\nВкажіть точку вставки:");

            po.UserInputControls =
                (AcEd.UserInputControls.Accept3dCoordinates |
                 AcEd.UserInputControls.NullResponseAccepted |
                 AcEd.UserInputControls.NoNegativeResponseAccepted |
                 AcEd.UserInputControls.GovernedByOrthoMode);

            AcEd.PromptPointResult ppr = jp.AcquirePoint(po);

            if (ppr.Status == AcEd.PromptStatus.Keyword)
            {
                return(AcEd.SamplerStatus.NoChange);
            }
            else if (ppr.Status == AcEd.PromptStatus.OK)
            {
                if (_location.DistanceTo(ppr.Value) < AcGe.Tolerance.Global.EqualPoint)
                {
                    return(AcEd.SamplerStatus.NoChange);
                }
                _location = ppr.Value;
                return(AcEd.SamplerStatus.OK);
            }
            return(AcEd.SamplerStatus.Cancel);
        }
コード例 #2
0
ファイル: RectangleJig.cs プロジェクト: ArtemLoban/LoSa.Land
        protected override AcEd.SamplerStatus Sampler(AcEd.JigPrompts prompts)
        {
            AcEd.JigPromptPointOptions jppo = new AcEd.JigPromptPointOptions();
            AcEd.PromptPointResult     ppr;

            jppo.Message      = this.methodConstructing.GetMessage();
            jppo.UseBasePoint = false;

            ppr = prompts.AcquirePoint(jppo);

            if (ppr.Status == AcEd.PromptStatus.Cancel || ppr.Status == AcEd.PromptStatus.Error)
            {
                return(AcEd.SamplerStatus.Cancel);
            }
            AcGe.Point3d tmpPt = ppr.Value.TransformBy(UCS.Inverse());
            if (!this.diagonalPoint.IsEqualTo(tmpPt, new AcGe.Tolerance(10e-10, 10e-10)))
            {
                this.diagonalPoint = tmpPt;
                return(AcEd.SamplerStatus.OK);
            }
            else
            {
                return(AcEd.SamplerStatus.NoChange);
            }
        }
コード例 #3
0
 protected override AcEd.SamplerStatus Sampler(AcEd.JigPrompts prompts)
 {
     AcEd.JigPromptPointOptions jppo = new AcEd.JigPromptPointOptions("\nВершина ('Enter' закінчити):");
     jppo.UseBasePoint      = false;
     jppo.UserInputControls = AcEd.UserInputControls.NullResponseAccepted |
                              AcEd.UserInputControls.Accept3dCoordinates |
                              AcEd.UserInputControls.GovernedByUCSDetect |
                              AcEd.UserInputControls.GovernedByOrthoMode |
                              AcEd.UserInputControls.AcceptMouseUpAsPoint;
     AcEd.PromptPointResult prResult1 = prompts.AcquirePoint(jppo);
     if (prResult1.Status == AcEd.PromptStatus.Cancel || prResult1.Status == AcEd.PromptStatus.Error)
     {
         return(AcEd.SamplerStatus.Cancel);
     }
     AcGe.Point3d tmpPt = prResult1.Value.TransformBy(UCS.Inverse());
     lastVertex = tmpPt;
     return(AcEd.SamplerStatus.OK);
 }
コード例 #4
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);
            }
        }
コード例 #5
0
ファイル: LandBlockJig.cs プロジェクト: ArtemLoban/LoSa.Land
        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);
            }
        }