Weapons are defined in PC 46.01 and common pocket knives are not weapons, so there is no law prohibiting you from carrying them in a courthouse.
Not arguing your point...
But for discussion. PC 46.01 says
"(7) "Knife" means any bladed hand instrument that is capable of inflicting serious bodily injury or death by cutting or stabbing a person with the instrument."
I ANAL, however......it would seem this is a gray area, and the LEO or judge could look at almost ANY knife and say it is capable of inflicting serious bodily injury by stabbing if the blade is more than say an inch long.
Would you consider being stabbed / slashed in the carotid or brachial or femoral artery a serious injury? knowing you can bleed out in minutes from such a wound?
How about being stabbed in the eye? trachea?
Any of that takes a knife of just an inch or less in most cases.. morbidly obese persons may be safer from a slashing or stabbing attack to an artery. And a judge may be well within thier authority to restrict carrying such a "dangerous" weapon.