-- Script to erase all spinlinks in a project -- F. Damberger 29.April.2004 -- --22.June.2004 -- modified to allow user to select project in a dialog window -- WARNING: this script erases large numbers of spinlinks from project. -- Always Back-up your Repository before executing the script! -- comment in line below to print out each erased spinlink -- local PrintResults = true ---------------------------------------------------------------------- -- Create array to hold all script variables t={} --1. Get ProjectName local ProjectNames = {} t.i = 0 for a,b in pairs( cara:getProjects() ) do t.i = t.i + 1 ProjectNames[ t.i ] = b:getName() end t.ProjectName=dlg.getSymbol("Select Project","", unpack( ProjectNames ) ) t.P = cara:getProject( t.ProjectName ) -- get Project t.P=cara:getProject(t.ProjectName) -- ---------------------------------------------------------------------- t.SL = t.P:getSpinLinks() t.i = 0 for a,b in pairs( t.SL ) do -- erase spinlink t.P:unlinkSpins( t.P:getSpin(b:getLeft()),t.P:getSpin( b:getRight() ) ) t.i = t.i + 1 if PrintResults then print( "erased link from spin"..b:getLeft().. " to "..b:getRight() ) end end print( "erased "..t.i.." spinlinks" ) print( "DeleteSpinLinks is done" ) t = nil