[JW Lua] Slur segment does not return measure pos

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Jul 15 23:10:37 CEST 2014


Jan,

You only get the MeasurePos if the smart shape is measure-attached. If 
the shape is entry-attached, you need to get the entry number and then 
load+map to the entry, where you can get the entry's MeasurePos.


Best regards,

Jari Williamsson


On 2014-07-15 22:04, Jan Angermüller wrote:
> Jari,
>
> if I create an FCSmartShapeSegment from an FCSmartShape that is a slur
> (IsSlur() == true),
> then MeasurePos from FCSmartShapeSegment returns a strange result which
> is not
> the MeasurePos.
> It seems to me like an entry or identification number is returned instead.
> The difference between the left and the right measure pos is usually the
> number of note entries below the slur.
>
> Try this script on a selected measure with a slur:
>
> local marks = finale.FCSmartShapeMeasureMarks()
> marks:LoadAllForRegion( finenv.Region(), true)
> for mark in each(marks) do
>      local smartshape = mark:CreateSmartShape()
>      if (smartshape ~= nil) then
>            local leftseg = smartshape:GetTerminateSegmentLeft()
>            local rightseg = smartshape:GetTerminateSegmentRight()
>            print("Left MeasurePos",leftseg.MeasurePos)
>            print("Right MeasurePos",rightseg.MeasurePos)
>     end
> end
>
> It should return for example 0 and 4096 in a 4/4 measure with
> one big slur over all notes, but it returns something like 24123 and 24126.
>
> For smartshape hairpins the left/right measure pos are ok.
> It's only the slurs that have this problem.
>
> Jan
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list