====== Scripts > DM_Clip ====== ^ Description | A script to clip the altitude range of the design map (maximum, minimum or both). | ^ Author | Aaron | ^ Created | 2010/07/07 | ^ Requires | L3DT v2.9 beta or later | ^ Download | {{:scripts:DM_Clip.zs|DM_Clip.zs}} | ===== Script contents ===== // // Title | DM_Clip // Purpose | A script to clip the altitude layer of the design map // Author | Aaron Torpy // Date | 7 July 2010 // hvar hDM set hDM assert > "Error: Design map is not present" assert "Error: Design map is not initialised" // ask for clipping mode combosel CS combosel.InitCS &CS "Clip above|Clip below|Clip both" "Clip above" if > return -1 endif // check clipping mode, and ask for clipping altitudes float ClipAltMin float ClipAltMax set ClipAltMin 0 set ClipAltMax 0 int ClipMode set ClipMode 0 if "Clip above"> set ClipMode 0 if > return -1 endif elseif "Clip below"> set ClipMode 1 if > return -1 endif elseif "Clip both"> set ClipMode 2 if > return -1 endif if > return -1 endif else echo "ClipDesignMap script error:\r\n - unknown clipping mode" return -1 endif //echo // debugging // create temp HF to contain DM alt layer map TempHF if > echo "ClipDesignMap script error:\r\n - cannot extract altitude layer from design map" return -1 endif // store a backup if > echo "ClipDesignMap script error:\r\n - cannot store backup point for design map" //return -1 endif // clip the design map alt layer if > if > echo "ClipDesignMap script error:\r\n - cannot clip max altitude layer of design map" return -1 endif endif // clip the design map alt layer if > if > echo "ClipDesignMap script error:\r\n - cannot clip min altitude layer of design map" return -1 endif endif // copy back to design map if > echo "ClipDesignMap script error:\r\n - cannot copy altitude layer into design map" return -1 endif // redraw design map view.ShowMap "DM" MessageBox "Clipping complete!" 0x40 return 0 ===== Comments ===== None.