Template cleaner

added purgeCADlinepatterns function