[JW Lua] Problem with FCSmartShapeSegment OffsetX

Jan Angermüller jan at angermueller.com
Tue Jan 28 22:21:16 CET 2014


Hi Jari,

thank you very much for the info about the expression category. Good to 
know.
Maybe you could add this info to the documentation ?


I am also having a problem setting the EndpointOffsetX
when assigning a new smart shape (measure-based) to a measure.

This is what the following code should do to a selected measure:
insert a smart shape bracket from measurepos 1024 to 3072
and move the left end point with OffsetX 200 and OffsetY 27
and the right end point with OffsetX 0 and OffsetY 27.

The code does everything fine, except for the OffsetX which
doesn't change, no matter what value I enter.
The OffsetY works fine though and is displayed correctly.
As GetEndpointOffsetX returns the correct value - the one
that was set before - it may be just a display update problem ?
Do I have to set a flag for updating the offset ?

It is strange because when duplicating an existing smart shape
(instead of creating a new one) and assigning it to a new
position the offset X works fine.


         local region = finale.FCMusicRegion()
         region:SetCurrentSelection()

         local smartshape = finale.FCSmartShape()
         smartshape:SetShapeType(finale.SMARTSHAPE_SOLIDLINEDOWN)
         smartshape:SetEntryBased(false)
         smartshape:SetLineID(0)
         smartshape:SetMakeHorizontal(true)
         smartshape:SetVisible(true)
         smartshape:SetPresetShape(true)
         local leftseg = smartshape:GetTerminateSegmentLeft()
         leftseg:SetMeasure(region.StartMeasure)
         leftseg:SetMeasurePos(1024)
         leftseg:SetStaff(region.StartStaff)
         leftseg:SetEndpointOffsetX(200)
         leftseg:SetEndpointOffsetY(27)
         local rightseg = smartshape:GetTerminateSegmentRight()
         rightseg:SetMeasure(region.StartMeasure)
         rightseg:SetMeasurePos(3072)
         rightseg:SetStaff(region.StartStaff)
         rightseg:SetEndpointOffsetX(0)
         rightseg:SetEndpointOffsetY(27)
         smartshape:SaveNewEverything(NULL,NULL)
         print("OffsetX L:", leftseg:GetEndpointOffsetX(), 
"R:",rightseg:GetEndpointOffsetX())

Do you have any idea for that problem ?

Best regards,
Jan




More information about the JWLua mailing list