[JW Lua] entry:SetMeasurePos(value) not working

Robert Wildling robertwildling at gmail.com
Thu Oct 5 15:06:40 CEST 2017


Hi,

I am trying to position a note entry in a measure using
"e:SetMeasurePos(pos)" in this script:

```
-- Reset the notes in the note group
-- do this by adding the (i*averageDist) amount to the startDist
function resetNotes()
    local j = 0

    -- hardcoded values (for this question only)
    local averageDist = 243
    local startPosInMeasure = -83

    for e in eachentrysaved(finenv.Region()) do

        print("original Position of e:", e.MeasurePos)
        local pos = startPosInMeasure + (averageDist * j)
        --e:SetManualPosition(pos) . -- this works, but does not yield the
desired result
        e:SetMeasurePos(pos) . -- this does not work...

         j = j+1

    end

end
```

But unfortunately this does not work, while e:SetManualPosition(pos) does
work. Can anybody tell me, what I am doing wrong here?

Thank you!
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20171005/86a3fc2c/attachment.htm>


More information about the JWLua mailing list