예제 #1
0
        static void InsertHead(int coverage)
        {
            Editor().WriteMessage("\nInserting head...");

            ObjectId layerId = Layer.Ensure("HeadCoverage", ColorIndices.Yellow);

            Layer.Show(layerId);
            object osmode = Application.GetSystemVariable("OSMODE");

            Application.SetSystemVariable("OSMODE", 65);

            HeadBuilder.Insert(coverage);

            Layer.Hide(layerId);
            Application.SetSystemVariable("OSMODE", osmode);
        }
예제 #2
0
        static void InsertHeadSideWall(int coverage)
        {
            Editor().WriteMessage("\nInserting head...");

            ObjectId layerId = Layer.Ensure("HeadCoverage", ColorIndices.Yellow);

            Layer.Show(layerId);
            object osmode    = Application.GetSystemVariable("OSMODE");
            object orthomode = Application.GetSystemVariable("ORTHOMODE");

            Application.SetSystemVariable("OSMODE", 65);
            Application.SetSystemVariable("ORTHOMODE", 1);

            var pointResult = Editor().GetPoint("Where to place head");

            if (pointResult.Status != PromptStatus.OK)
            {
                return;
            }

            var options = new PromptAngleOptions("Angle of sidewall spray (press F8 to turn ORTHO off)")
            {
                BasePoint    = pointResult.Value,
                UseBasePoint = true
            };

            var angleResult = Editor().GetAngle(options);

            if (angleResult.Status == PromptStatus.OK)
            {
                HeadBuilder.Insert(coverage, pointResult.Value, angleResult.Value);
            }

            Layer.Hide(layerId);
            Application.SetSystemVariable("OSMODE", osmode);
            Application.SetSystemVariable("ORTHOMODE", orthomode);
        }