theTheme = av.GetActiveDoc.GetEditableTheme theFTab = theTheme.getftab recs = theFTab.GetSelection if (recs.count>1) then msgbox.info("More than 1 shapes selected. Exiting...","Warning") exit end for each rec in recs f_shape = theFTab.findfield("Shape") poly = theFTab.ReturnValue (f_shape, rec) recnumber = rec end polylist = {poly} theFTab.SelectByShapes (polylist, #VTAB_SELTYPE_NEW) recs = theFTab.GetSelection for each rec in recs if (rec <> recnumber) then if (System.IsShiftKeyDown.Not) then shpBack = theFTab.ReturnValue(f_shape,rec) shpFront = theFTab.ReturnValue(f_shape,recnumber) shpDiff = shpFront.ReturnDifference (shpBack) theFTab.SetValue(f_Shape,recnumber,shpDiff) else shpBack = theFTab.ReturnValue(f_shape,rec) shpFront = theFTab.ReturnValue(f_shape,recnumber) shpDiff = shpBack.ReturnDifference (shpFront) theFTab.SetValue(f_Shape,rec,shpDiff) end end end theFTab.UpdateSelection theTheme.Invalidate(TRUE)