Text bug (backwards compatibility bug #2)

V6 continues to screw up old files. I discovered, again way too late, that if a v4 file is opened in v6 and saved back as v4, all the text is shifted in Y. Hours and maybe days will be wasted fixing old drawings now. Thank you McNeel.

Yes, I understand it was foolish on my part to trust that V6 would sabotage old files like this, but that’s I waited to upgrade. Obviously, serious bugs are still not fixed.

Please, McNeel, either do NOT break forward compatibility for the sake of forcing upgrades, or do NOT break backwards compatibility. When you break it both ways, you royally screw up users that have to use multiple versions for whatever reasons. Now I have to make sure that in a multiuser multi-version environment that old files are not opened and saved with new version, or I will waste additional time and effort to try to undo these screwups and potentially more by trying to script ad-hoc fixes.

Fix for the problem described above. Use at your own risk:

Option Explicit


Function FixTextObjectShift()
  Dim A,i,H,P,V,R
  A = Rhino.AllObjects()
  If IsNull(A) Then Exit Function
  R = Rhino.EnableRedraw(False)
  For i=0 To UBound(A)
    If Rhino.IsText(A(i)) Then
      H = Rhino.TextObjectHeight(A(i))
	  P = Rhino.TextObjectPlane(A(i))
	  V = Rhino.VectorScale(P(2),-H)
	  Call Rhino.MoveObject(A(i),V)
  	End If
  Call Rhino.EnableRedraw(R)

End Function

Of course, now that you have identified the bug, an obvious preventative measure would be to make copies of all the old files and archive them - a precaution that, as you say, shouldn’t be necessary. Nice that you have been able to work up a script that repairs the damage.

Thank you, good point about backups, the importance of which cannot be overemphasized. Of course we have regular backups, but 1) it’s still a waste of time having to go back especially on a per file basis 2) in a multi-user automated production environment, it’s easier said than done to create exceptions going forward. What if a user, or a script, by mistake opens a file in v6 and saves it with its original version? There is virtually no feasible way to track how many times a file may have been saved from v6 with an old version, with each save shifting the text some more. Next time one of many automated scripts generates a drawing; all the text on them will be mangled and someone has to manually fix it or restore it from backup archives. It’s the uncertainty of not being able to trust your software or processes that’s a big time waster, even if the damage is minimal or easily fixed.

You didn’t post a file to test, but I’m thinking the problem is the following:

In V4, the text insertion point was always at the lower left corner, that is to say that text was bottom left justified. In V5 and especially V6, the horizontal text justifications centered and right were added along with the vertical justifications middle and top. So now there are 9 possibilities of where the text falls relative to the insertion point. In V6 it got worse, as text now obeys the current dimension style. And the default style is top left, not bottom left. Coming from V4, I’m not sure how well the older text styles were imported.

I’m pretty sure the text insertion point did not change when you opened your V4 file in V6. You might check that by turning on points for the same text in V4 and in V6 and comparing the coordinates of the insertion point for the same text object in both. But the justification probably changed, and so your text moved down.

If that’s the case (no guarantees) then all you need to do is select the text in V6 and change the justification back to bottom left, a script is not needed to actually move the insertion point. If that’s not the case, it would be nice to have a V4 format file that shows the problem when imported into V6.