New dimension (Can any one explain me please)

How can i get line automatically based on family instance orientation???

I can get dimensions to do what i want it to do but i have to manually create line.

Is there a way to create line reference for it and be able to control offset ???

`public Dimension NewDimension(
View view,
Line line,
ReferenceArray references
 )

Lookint at this http://thebuildingcoder.typepad.com/blog/2014/11/picking-pairs-and-dimensioning-family-instance-origin.html

I cant figure out how hes get line reference

can any one please help me??

Regards