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

I cant figure out how hes get line reference

can any one please help me??