Example #1
0
 public static void SelectComponent(string targetDagName, ConstantValue.PolySelectType pst, bool selectAll = false)
 {
     if (selectAll)
     {
         MGlobal.clearSelectionList();
         MGlobal.executeCommand(string.Format("doMenuComponentSelectionExt(\"{0}\", \"{1}\", 0)", targetDagName, ConstantValue.ComponentSelectionExt(pst)));
         SelectAll();
     }
     else
     {
         MGlobal.executeCommand(string.Format("doMenuComponentSelectionExt(\"{0}\", \"{1}\", 0)", targetDagName, ConstantValue.ComponentSelectionExt(pst)));
     }
 }
Example #2
0
        public static MSelectionList InvertSelect(MSelectionList list, MDagPath targetDag, ConstantValue.PolySelectType pst, bool recoverOriginSelection = false)
        {
            if (list == null)
            {
                return(null);
            }
            MSelectionList originSelection = GetSelectedList();

            if (targetDag != null)
            {
                Select(targetDag);
            }
            Select(list);
            MGlobal.executeCommand(string.Format("doMenuComponentSelectionExt(\"{0}\", \"{1}\", 0)", targetDag.fullPathName, ConstantValue.ComponentSelectionExt(pst)));
            MGlobal.executeCommand("InvertSelection");
            MSelectionList result = GetSelectedList();

            if (recoverOriginSelection)
            {
                Select(originSelection);
            }
            return(result);
        }