Beispiel #1
0
        /// <summary>
        /// Set the default display colour of the layer with the specified ID.
        /// </summary>
        /// <param name="layerPath"></param>
        /// <param name="colour"></param>
        /// <returns></returns>
        public static bool SetLayerColour(int layerID, Colour colour)
        {
            var layer = RhinoDoc.ActiveDoc.Layers[layerID];

            layer.Color = ToRC.Convert(colour);
            return(layer.CommitChanges());
        }
Beispiel #2
0
        /// <summary>
        /// Replace an object in the current Rhino document with a point object
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="point"></param>
        /// <returns></returns>
        public static bool ReplacePoint(Guid obj, Vector point)
        {
            bool result = false;

            Writing = true;
            result  = ReplacePoint(obj, ToRC.Convert(point));
            Writing = false;
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// Bake a piece of Nucleus geometry in the active Rhino document
        /// </summary>
        /// <param name="geometry"></param>
        /// <returns></returns>
        public static Guid Bake(VertexGeometry geometry)
        {
            Guid result = Guid.Empty;

            if (geometry != null)
            {
                GeometryBase gB = ToRC.Convert(geometry);
                if (gB != null)
                {
                    Writing = true;
                    result  = Bake(gB);
                    Writing = false;
                }
                //else throw new NotImplementedException();
            }

            return(result);
        }
Beispiel #4
0
 /// <summary>
 /// Add a curve to the Rhino document
 /// </summary>
 /// <param name="curve"></param>
 /// <returns></returns>
 public static Guid BakeCurve(FB.Curve curve)
 {
     return(BakeCurve(ToRC.Convert(curve)));
 }
Beispiel #5
0
 /// <summary>
 /// Add a point to the current Rhino document
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public static Guid BakePoint(Vector point)
 {
     return(BakePoint(ToRC.Convert(point)));
 }
Beispiel #6
0
 /// <summary>
 /// Replace an object in the current Rhino document
 /// </summary>
 /// <param name="objID"></param>
 /// <param name="geometry"></param>
 /// <returns></returns>
 public static bool Replace(Guid objID, VertexGeometry geometry)
 {
     return(Replace(objID, ToRC.Convert(geometry)));
 }
Beispiel #7
0
 /// <summary>
 /// Replace an existing object in the Rhino document with a line object
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="startPoint"></param>
 /// <param name="endPoint"></param>
 /// <returns></returns>
 public static bool ReplaceLine(Guid obj, Vector startPoint, Vector endPoint)
 {
     return(ReplaceLine(obj, ToRC.Convert(startPoint), ToRC.Convert(endPoint)));
 }
Beispiel #8
0
 /// <summary>
 /// Add a line between two points to the current Rhino document
 /// </summary>
 /// <param name="startPoint"></param>
 /// <param name="endPoint"></param>
 /// <returns></returns>
 public static Guid BakeLine(Vector startPoint, Vector endPoint)
 {
     return(BakeLine(ToRC.Convert(startPoint), ToRC.Convert(endPoint)));
 }
Beispiel #9
0
 /// <summary>
 /// Replace an existing curve in the Rhino document
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="curve"></param>
 /// <returns></returns>
 public static bool ReplaceCurve(Guid obj, FB.Curve curve)
 {
     return(ReplaceCurve(obj, ToRC.Convert(curve)));
 }
Beispiel #10
0
 public override int AddVertex(Vector pt)
 {
     return(_Mesh.Vertices.Add(ToRC.Convert(pt)));
 }