DeleteLayerById

<< Click to Display Table of Contents >>

Navigation:  MyCAD > Methods >

DeleteLayerById

public Boolean DeleteLayerById(Int32 layerId)

 

Description:

 Delete layer by the layer's id, if  layerId not matched, it returns false. This function will delete shape(s) which belonged this layer.

 

Parameter:

 layerId: Layer id

 

Return value:

 true: Delete successfully

 false: Delete unsuccessfully

 

Example:

 private void btnDelete_Click(object sender, System.EventArgs e)

 {

         Int32 id;

         if (treeView1.SelectedNode.Index > -1)

         {

                 id = mainForm.myCAD1.GetLayerIdByNo(treeView1.SelectedNode.Index);

                 mainForm.myCAD1.DeleteLayerById(id);

                 RefreshIt();

         }

         treeView1.Focus();

 }

 

See also:

 DeleteLayerByName