<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Jari,<br>
<br>
below is another<b> glissando smartshape test script</b> that
demonstrates the weird metrics behaviour.<br>
If you use it with the attached musx file, it will create two
glissandos:<br>
<br>
1.) the first one in measure 1 uses default offset, i.e.
FCSmartShapeSegment:SetEndpointOffsetY(0)<br>
and is <b>v</b><b>isible in scroll view, but at the wrong position,
but not visible in score view. </b><br>
<br>
2.) the second one in measure 2 uses custom offset, i.e.
FCSmartShapeSegment:SetEndpointOffsetY(FCEntryMetrics.BottomPosition)<br>
and is <b>visible in score view at (nearly) the correct position,
but not visible in scroll view</b>.<br>
<br>
Any ideas ? There must be a metrics problem somewhere. <br>
<br>
In a much more complex environment I also had the situation <br>
that calling FCNote:CalcAccidental() automatically moved the <br>
attached custom offset glissando to a new position. It was
reproduceable<br>
in the complex script, but not in the reduced test script below.<br>
I tested with Finale 2014d/Windows/JW Lua 0.30.<br>
<br>
Best regards,<br>
Jan<br>
<br>
function CreateGlissandoSmartshape(noteentrylayer,firsttime)<br>
for e in each(noteentrylayer) do<br>
if e.MeasurePos==0 then -- take note on measure pos 0 ...<br>
for e2 in each(noteentrylayer) do<br>
if e2.MeasurePos==2048 then -- ... and note on
measure pos 2048 ...<br>
local smartshape = finale.FCSmartShape() --
... and add a glissando smartshape<br>
<br>
--set smartshape glissando flags<br>
smartshape:SetEntryAttachedFlags(true)<br>
smartshape:SetEntryBased(true)<br>
smartshape:SetPresetShape(true)<br>
smartshape:SetShapeType(finale.SMARTSHAPE_GLISSANDO)<br>
smartshape:SetLineID(1)<br>
<br>
--connect segments to measure/staff<br>
local leftseg =
smartshape:GetTerminateSegmentLeft()<br>
local rightseg =
smartshape:GetTerminateSegmentRight()<br>
leftseg:SetMeasure(e.Measure)<br>
rightseg:SetMeasure(e2.Measure)<br>
leftseg:SetStaff(e.Staff)<br>
rightseg:SetStaff(e2.Staff)<br>
<br>
--set flags for custom offset<br>
if firsttime then --first time don't use
custom offset and set to default position<br>
leftseg:SetCustomOffset(true) --No left
custom offset<br>
rightseg:SetCustomOffset(false) -- No
right custom offset<br>
leftseg:SetEndpointOffsetX(0) <br>
rightseg:SetEndpointOffsetX(0)<br>
leftseg:SetEndpointOffsetY(0) <br>
rightseg:SetEndpointOffsetY(0)<br>
else --second time use custom offset and
shift vertical position up <br>
--load entrymetrics for shifting up the
glissando to the note<br>
local
entrymetrics=finale.FCEntryMetrics()<br>
entrymetrics:Load(e)<br>
local
entrymetrics2=finale.FCEntryMetrics()<br>
entrymetrics2:Load(e2)<br>
local pagescale = 0.8547 --page scale in
score view in the attached glissando.musx file<br>
<br>
leftseg:SetCustomOffset(false) --Use
left custom offset<br>
rightseg:SetCustomOffset(true) -- Use
right custom offset<br>
leftseg:SetEndpointOffsetX(0)<br>
rightseg:SetEndpointOffsetX(0)<br>
leftseg:SetEndpointOffsetY(entrymetrics.BottomPosition/pagescale)
--Y coordinate requires shifting up from bottom of page to
noteentry.BottomPosition<br>
rightseg:SetEndpointOffsetY(entrymetrics2.BottomPosition/pagescale)<br>
end<br>
<br>
smartshape:SaveNewEverything(e,e2) --Save
smartshape<br>
break --we're finished with the demo<br>
end<br>
end<br>
end<br>
end<br>
end<br>
<br>
--Make sure Metrics are setup correctly (not necessary in this
script, but anyway...)<br>
finale.FCEntryMetrics:MarkMetricsForRebuild()<br>
finale.FCCellMetrics:MarkMetricsForRebuild()<br>
<br>
--Create glissando in measure 1 with default offset<br>
local noteentrylayer=finale.FCNoteEntryLayer(0,1,1,1) --load layer 1
in measure 1 staff 1<br>
noteentrylayer:Load() <br>
CreateGlissandoSmartshape(noteentrylayer,true)<br>
<br>
--Create glissando in measure 1with custom offset<br>
noteentrylayer=finale.FCNoteEntryLayer(0,1,2,2) --load layer 1 in
measure 2 staff 1<br>
noteentrylayer:Load() <br>
CreateGlissandoSmartshape(noteentrylayer,false)<br>
</body>
</html>