How we can create dimension link similar to line in FloorPlan project for any object

How we can create dimension link similar to line in FloorPlan project for any object

Well, you have the complete code there in that project. If you were specific about what problem you are having adapting that code, perhaps we could give some advice.

It might be easier starting at Using Dimensioning Links.