protected override Result RunCommand(RhinoDoc doc, RunMode mode) { // TODO: complete command. Brep my_brep = My_object_functions.Initialize("D:/Desktop/MyObject_1pin.3dm"); My_object_functions.SetName(my_brep, "my_object_1_pin"); My_object_functions.SetColor(my_brep, Color.Red); My_object_functions.SetPosition(my_brep, new Point3d(0, 10.0, 0)); My_object_functions.SetZ(my_brep, new Vector3d(0, -1.0, 0)); My_object_functions.SetY(my_brep, new Vector3d(1.0, 0, 0)); My_object_functions.SetX(my_brep, new Vector3d(0.0, 0, 1.0)); My_object_functions.SetPinQuantity(my_brep, 1); My_object_functions.SetPinCoordination(my_brep, 0, new Point3d(0, 0, 0)); for (int i = 0; i < 1; i++) { My_object_functions.SetPinGuid(my_brep, i, Guid.NewGuid()); } ObjectAttributes my_attributes = new ObjectAttributes(); my_attributes.ColorSource = ObjectColorSource.ColorFromObject; my_attributes.ObjectColor = My_object_functions.GetColor(my_brep); MyRhino5rs11project8PlugIn p = MyRhino5rs11project8PlugIn.Instance; p.my_objects_list.Add(my_brep); doc.Objects.AddBrep(my_brep, my_attributes); doc.Views.Redraw(); return(Result.Success); }
protected override Result RunCommand(RhinoDoc doc, RunMode mode) { // TODO: complete command. Brep my_brep = My_object_functions.Initialize("D:/Desktop/MyObject_4pins.3dm"); My_object_functions.SetName(my_brep, "my_object_4_pins"); My_object_functions.SetColor(my_brep, Color.Blue); My_object_functions.SetPosition(my_brep, new Point3d(0, 0, -5.0)); My_object_functions.SetPinQuantity(my_brep, 4); My_object_functions.SetPinCoordination(my_brep, 0, new Point3d(7.5, 5.0, 0.0)); My_object_functions.SetPinCoordination(my_brep, 1, new Point3d(-7.5, 5.0, 0.0)); My_object_functions.SetPinCoordination(my_brep, 2, new Point3d(7.5, -5.0, 0.0)); My_object_functions.SetPinCoordination(my_brep, 3, new Point3d(-7.5, -5.0, 0.0)); for (int i = 0; i < 4; i++) { My_object_functions.SetPinGuid(my_brep, i, Guid.NewGuid()); } ObjectAttributes my_attributes = new ObjectAttributes(); my_attributes.ColorSource = ObjectColorSource.ColorFromObject; my_attributes.ObjectColor = My_object_functions.GetColor(my_brep); /* * Point3d position = My_object_functions.GetPosition(my_brep); * Vector3d d_x = My_object_functions.GetX(my_brep); * Vector3d d_y = My_object_functions.GetY(my_brep); * Vector3d d_z = My_object_functions.GetZ(my_brep); * Line l_x = new Line(position, 10 * d_x); * Line l_y = new Line(position, 10 * d_y); * Line l_z = new Line(position, 10 * d_z); * * * ObjectAttributes path_attributes = new ObjectAttributes(); * path_attributes.ObjectColor = Color.Yellow; * path_attributes.ColorSource = ObjectColorSource.ColorFromObject; * path_attributes.PlotWeightSource = ObjectPlotWeightSource.PlotWeightFromObject; * path_attributes.PlotWeight = 2.0; * * * doc.Objects.AddLine(l_x, path_attributes); * doc.Objects.AddLine(l_y, path_attributes); * doc.Objects.AddLine(l_z, path_attributes); */ MyRhino5rs11project8PlugIn p = MyRhino5rs11project8PlugIn.Instance; p.my_objects_list.Add(my_brep); doc.Objects.AddBrep(my_brep, my_attributes); doc.Views.Redraw(); return(Result.Success); }