// Toggle the part visibility
 public static void Toggle(Part part)
 {
     if (PartAdapter.IsHidden(part))
     {
         PartAdapter.Show(part);
     }
     else if (PartAdapter.IsShown(part))
     {
         PartAdapter.Hide(part);
     }
 }
 // Find index of a visible part in an array (1st occurance)
 public static int FindShown(Part[] parts)
 {
     for (int i = 0; i < parts.Length; i++)                                                                  // For each part
     {
         if (PartAdapter.IsShown(parts[i]))                                                                  // If it is visible
         {
             return(i);                                                                                      // Return index
         }
     }
     return(-1);                                                                                                                             // If no visible parts found, return -1
 }