Apply NearFarScalar to Polyline width

I’d like to apply a NearFarScalar to the width of a polyline, so that it appears thinner from far away.
I see in sandcastle examples that NearFarScalars are only applied to properties that have ‘ByDistance’ in their name, so I assumed this does not work on ‘regular’ properties such as width, and indeed it doesn’t seem to have any effect. Next, I experimented with using a callback property returning a NearFarScalar, but that doesn’t have any effect on the displayed polyline width either.

Is it at all possible to vary the polyline width by it’s distance to the camera in any way?
Perhaps I can set up a CallbackProperty that takes the camera distance in account, but I don’t know how to get a reference to that distance inside the callback function.

Any help is greatly appreciated.