In patent English, I sometimes encounter 'a length of the surface', 'a length of the surface'or 'the length of the surface,' for example.

I think that you use 'a length of' when you are talking about a specific unit of a measurement. And you use 'a length of' to indicate 'a length of an object(which is not specified)'. On the contrary, you use 'the length of' when you are talking about 'the length of a specific object' or 'the length of the object which was mentioned before.'

Am I understood right?

please explain this in detail with examples. I would be really appreciate it. 

p.s. Is the same explanation applied to 'height, weight, and size'?

Thanks and sorry for my poor English. (I am not a native speaker.)