ensure text is not upside down

Discussion in 'AutoCAD' started by ajtruckle, Nov 11, 2004.

  1. ajtruckle

    ajtruckle Guest

    i have a line and i have the angle of the line and i have a coordinate (a endpoint of the line).

    i want to put text on the line at the rotation of the line. but i want the text not upside down.

    how to i ascertain that the angle and line direction is going to make the text upside down.

    I used AngleFromXAxis to get the current angle of the line...)
     
    ajtruckle, Nov 11, 2004
    #1
  2. ajtruckle

    Bill Debevc Guest

    I would check the angle to see if it is grater that 180 if so then the text
    will be "reversed" so switch the end points.

    Bill Debevc
     
    Bill Debevc, Nov 11, 2004
    #2
  3. From 271 to 90 degrees, line angle should be fine so text should be written
    from start point using angle from start point to end point)
    From 91 to 270, text will be upside down so text should be written from end
    point using angle from end point to start point
     
    Jorge Jimenez, Nov 12, 2004
    #3
  4. ajtruckle

    ajtruckle Guest

    Yes, I realised this last night. So I added in this check:

    If dRotAsDeg > 90# And dRotAsDeg <= 270# Then

    Although I had < 270.

    To rotate the text, I did this:

    ' Get location of text
    Call .GetBoundingBox(min, max)
    ' Calculate center point
    center(0) = min(0) + ((max(0) - min(0)) / 2#)
    center(1) = min(1) + ((max(1) - min(1)) / 2#)
    center(2) = objCoord(2)
    ' Rotate it round by 180 degrees
    Call .Rotate(center, Deg2Rad(180#))

    Is that the best or efficient way?

    Andrew
     
    ajtruckle, Nov 12, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.