Line Dimension, not by 2 Points

How to get automatic Line Dimension vertex to vertex by select one time.

sample from Autocad

Take Dim of line only by select object, not by point to point.

sample image from Autocad.