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()); }
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)); }
public void TestRegion() { var id = Interaction.GetEntity("\nEntity"); Draw.Region(id); var point = Interaction.GetPoint("\nPick one point"); Draw.Boundary(point, BoundaryType.Region); }
public static void InspectObject() { var id = Interaction.GetEntity("\nSelect objects"); if (id.IsNull) { return; } Gui.PropertyPalette(id.QOpenForRead()); }
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); }
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()); }
public void TestWipe() { var id = Interaction.GetEntity("\nEntity"); Draw.Wipeout(id); }