← All bug reports

FS#1178scripting definition point and vertical DIMs

Type
Bug
Status
Closed
Resolution
Not a bug
Category
ECMAScript
Severity
Low
Priority
Low
Reported version
3.7.7
Operating system
All
Reported
2015-02-04 by hungerburg
Closed
2015-02-04 by andrew

A regression? In my script I draw stacked dims (depth d):

    var c = RVector.getAverage(a, b); // Zentrum der Messung
    var dim = new RDimRotatedData();
    dim.setExtensionPoint1(a);
    dim.setExtensionPoint2(b);
    c.x = a.x + d * 50 + ( d > 0 ? 50 : -50 );
    dim.setDefinitionPoint(c);
    dim.setRotation(Math.PI / 2);

Curiosly, this would work in 3.7.5 but fail in 3.7.7: the DefinitionPoint would be ignored then, but only in vertical ones, not in horizontal ones!

More curiously still: The DIM gets drawn right as soon as I move the setRotation call before the setDefinitionPoint call!

PS: the debugger proved very helpful again :)

Comments (1)

andrew 2015-02-04

The DIM gets drawn right as soon as I move the setRotation call before the setDefinitionPoint call

setDefinitionPoint automatically 'corrects' the definition point to be at one end point of the dimension line. This is indeed new but improves user experience when drawing dimensions and later using drag and drop to change the dimension line position.

The call to setDefinitionPoint should be the last call to set up the dimension.