/// <summary>Modifies layer settings.</summary> /// <param name="newSettings">This information is copied.</param> /// <param name="layerIndex"> /// zero based index of layer to set. This must be in the range 0 <= layerIndex < LayerTable.Count. /// </param> /// <param name="quiet">if true, information message boxes pop up when illegal changes are attempted.</param> /// <returns> /// true if successful. false if layerIndex is out of range or the settings attempt /// to lock or hide the current layer. /// </returns> public bool Modify(Rhino.DocObjects.Layer newSettings, int layerIndex, bool quiet) { if (null == newSettings) { return(false); } IntPtr pLayer = newSettings.ConstPointer(); return(UnsafeNativeMethods.CRhinoLayerTable_ModifyLayer(m_doc.m_docId, pLayer, layerIndex, quiet)); }
/// <summary> /// Adds a new reference layer with specified definition to the layer table /// Reference layers are not saved in files. /// </summary> /// <param name="layer"> /// definition of new layer. The information in layer is copied. If layer.Name is empty /// the a unique name of the form "Layer 01" will be automatically created. /// </param> /// <returns> /// >=0 index of new layer /// -1 layer not added because a layer with that name already exists. /// </returns> public int AddReferenceLayer(Rhino.DocObjects.Layer layer) { if (null == layer) { return(-1); } IntPtr pLayer = layer.ConstPointer(); return(UnsafeNativeMethods.CRhinoLayerTable_AddLayer(m_doc.m_docId, pLayer, true)); }