[JW Lua] Attaching a new entry-based custom smart line to a score
Chris
marcel.denio at gmail.com
Tue Jun 28 18:20:56 CEST 2016
Hello Jan
Here is a sample that works.
But I don't understand whyit's necessary to put "PresetShape" to "true"
---------------------------------
local function createLine()
local csld = finale.FCCustomSmartLineDef()
csld.Horizontal = true
csld.LineStyle = finale.CUSTOMLINE_SOLID
csld.StartArrowheadStyle = finale.CLENDPOINT_HOOK
csld.StartHookLength = -1451
csld.EndArrowheadStyle = finale.CLENDPOINT_HOOK
csld.EndHookLength = -1451
csld.LineWidth = 363
csld:SaveNew()
return csld.ItemNo
end
local function createSmartShape(staff,measure,lineID)
local smartshape = finale.FCSmartShape()
smartshape.ShapeType = finale.SMARTSHAPE_CUSTOM
smartshape.EntryBased = false
smartshape.MakeHorizontal = true
smartshape.BeatAttached= true
smartshape.Visible = true
smartshape.PresetShape = true
smartshape.LineID= lineID
local leftseg = smartshape:GetTerminateSegmentLeft()
leftseg:SetMeasure(measure)
leftseg:SetMeasurePos(0)
leftseg:SetStaff(staff)
leftseg:SetEndpointOffsetX(0)
leftseg:SetEndpointOffsetY(30)
local rightseg = smartshape:GetTerminateSegmentRight()
rightseg:SetMeasure(measure)
rightseg:SetMeasurePos(4096)
rightseg:SetStaff(staff)
rightseg:SetEndpointOffsetX(0)
rightseg:SetEndpointOffsetY(30)
smartshape:SaveNewEverything(NULL,NULL)
end
local lineID = createLine()
createSmartShape(1,1,lineID)
---------------------------------
Best regards
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160628/d54f2942/attachment.htm>
More information about the JWLua
mailing list