-- hides all links in a selected spectrum -- F.Damberger June 24 2004. -- create array for script variables t = {} -- ---------------------------------------------------------------------- --1. Get ProjectName local ProjectNames = {} i = 0 for a,b in pairs(cara:getProjects()) do i = i + 1 ProjectNames[ i ] = b:getName() end if table.getn( ProjectNames ) > 1 then t.ProjectName=dlg.getSymbol("Select Project","", unpack( ProjectNames ) ) t.P = cara:getProject( t.ProjectName ) else t.P = cara:getProject( ProjectNames[ 1 ] ) end --2. get Spectrum to hide the spinlinks in local SpectrumNames = {} local SpectrumID = {} i = 0 for a,b in pairs( t.P:getSpectra() ) do i = i + 1 SpectrumNames[ i ] = b:getName() SpectrumID[ i ] = b:getId() end t.SpectrumName = dlg.getSymbol( "Select Spectrum to display Spinlinks in", "", unpack( SpectrumNames ) ) for i = 1, table.getn( SpectrumNames ) do if SpectrumNames[ i ] == t.SpectrumName then t.Spect = t.P:getSpectrum( SpectrumID[ i ] ) end end -- ----------------------------------------------------------- --3. Get SpinLinks and Hide them in selected spectrum t.SpinLinks = t.P:getSpinLinks() i = 0 for a,b in pairs( t.SpinLinks ) do t.Visible = b:isVisible() if t.Visible then i = i + 1 end t.Rating = b:getRating( t.Spect ) t.Code = b:getCode( t.Spect ) t.P:setLinkParams( b, t.Spect, t.Rating, t.Code, false ) end print( "Total number of Links hidden: "..i)