How to draw text at Line? How to calc direction for text placed on the line?

How to draw text at Line? How to calc direction for text placed on the line?

Anonymous
Not applicable
584 Views
2 Replies
Message 1 of 3

How to draw text at Line? How to calc direction for text placed on the line?

Anonymous
Not applicable

I did DrawableOverrule instance and override WorldDraw method.
In this method I have checked:


public override bool WorldDraw(Drawable d, WorldDrawwd)
{
  if (d isLine)
  {
      Line line = (Line)d;


Next I want to draw text placed on the line and I did:

 

   wd.Geometry.Text(line.StartPoint, normal, direction

 

Question is - how to calculate required direction for text that text should be placed on the line? Is it easy way to do it?

 

Thanks!

0 Likes
585 Views
2 Replies
Replies (2)
Message 2 of 3

StephenPreston
Alumni
Alumni

The Line.Delta property returns a vector along the direction of the line.

 

Cheers,

Stephen Preston
Autodesk Developer Network
Message 3 of 3

Anonymous
Not applicable

Thanks a lot, Stephen!

0 Likes