Yes. Absolutely. Even if you intend to plead guilty, a criminal lawyer would be able to communicate with the magistrate on your behalf, explain your options to you in detail, and often, the mere presence of a lawyer on your behalf may help to reduce your sentence. Did you have a "reasonable excuse" for carrying the knife? eg: you were on your way to go fishing, you were delivering the knife you borrowed from a friend, back to him/her, (if it was a multi-function knife) you needed it for the bottle opener or screwdriver... etc?