/// <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()); }
/// <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); }
/// <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); }
/// <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))); }
/// <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))); }
/// <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))); }
/// <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))); }
/// <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))); }
/// <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))); }
public override int AddVertex(Vector pt) { return(_Mesh.Vertices.Add(ToRC.Convert(pt))); }