Exemplo n.º 1
0
        public void TestMeasure()
        {
            var    id     = Interaction.GetEntity("\nSelect curve");
            var    cv     = id.QOpenForRead <Curve>();
            double length = Interaction.GetValue("\nInterval");

            Draw.Measure(cv, length, new DBPoint());
        }
Exemplo n.º 2
0
        public void ViewSpline()
        {
            var id         = Interaction.GetEntity("\nSelect a spline", typeof(Spline));
            var spline     = id.QOpenForRead <Spline>();
            var knots      = spline.NurbsData.GetKnots();
            var knotPoints = knots.Cast <double>().Select(k => spline.GetPointAtParam(k)).ToList();

            knotPoints.ForEach(p => Draw.Circle(p, 5));
        }
Exemplo n.º 3
0
        public void TestRegion()
        {
            var id = Interaction.GetEntity("\nEntity");

            Draw.Region(id);
            var point = Interaction.GetPoint("\nPick one point");

            Draw.Boundary(point, BoundaryType.Region);
        }
Exemplo n.º 4
0
        public static void InspectObject()
        {
            var id = Interaction.GetEntity("\nSelect objects");

            if (id.IsNull)
            {
                return;
            }
            Gui.PropertyPalette(id.QOpenForRead());
        }
Exemplo n.º 5
0
        public static void ViewObjectDict()
        {
            var id = Interaction.GetEntity("\nSelect entity");

            if (id == ObjectId.Null)
            {
                return;
            }
            var dv = new DictionaryViewer(  // Currying
                () => CustomObjectDictionary.GetDictionaryNames(id),
                dict => CustomObjectDictionary.GetEntryNames(id, dict),
                (dict, key) => CustomObjectDictionary.GetValue(id, dict, key),
                (dict, key, value) => CustomObjectDictionary.SetValue(id, dict, key, value)
                );

            Application.ShowModalWindow(dv);
        }
Exemplo n.º 6
0
        public static void PolylineInfo() // mod by WY 20130202
        {
            var id = Interaction.GetEntity("\nSpecify a polyline", typeof(Polyline));

            if (id == ObjectId.Null)
            {
                return;
            }
            var poly = id.QOpenForRead <Polyline>();

            for (int i = 0; i <= poly.EndParam; i++)
            {
                Interaction.WriteLine("[Point {0}] coord: {1}; bulge: {2}", i, poly.GetPointAtParameter(i), poly.GetBulgeAt(i));
            }
            var    txtIds = new List <ObjectId>();
            double height = poly.GeometricExtents.MaxPoint.DistanceTo(poly.GeometricExtents.MinPoint) / 50.0;

            for (int i = 0; i < poly.NumberOfVertices; i++)
            {
                txtIds.Add(Draw.MText(i.ToString(), height, poly.GetPointAtParameter(i), 0, true));
            }
            Interaction.GetString("\nPress ENTER to exit");
            txtIds.QForEach(mt => mt.Erase());
        }
Exemplo n.º 7
0
        public void TestWipe()
        {
            var id = Interaction.GetEntity("\nEntity");

            Draw.Wipeout(id);
        }