<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Jari,<br>
    <br>
    I haven't succeeded yet in adding a glissando smartshape at the
    correct position.<br>
    Probably it's the following sentence from
    FCSmartShape:SaveNewEverything()<br>
    that I am missing or that I don't understand:<br>
    "For note-attached smart shapes, the frame collection that <br>
    contains the entries need to be saved after the successful return
    from this method."<br>
    <br>
    The code snippet is below. It creates a glissando between two half
    notes<br>
    in measure 1 on staff 1. The glissando does appear in the score
    after the execution,<br>
    but at the wrong position (see screenshot: it's placed far above the
    staff).<br>
    <br>
    I tried to set as many properties as possible (Endpoints,
    CtrlPoints, etc. - not all of them are required here, I know).<br>
    But the glissando always appears at the <i>same </i>wrong position
    - <br>
    no matter which endpoint offsets I enter.<br>
    <br>
    I also tried it with FCNoteEntryCell and FCNoteEntryLayer instead of
    eachentrysaved(),<br>
    but that shouldn't and didn't make a difference.<br>
    What's the possibly required call for "saving the frame collection"
    after SaveNewEverything() ?<br>
    Or is there a problem with the endpoint assignment ?<br>
    I used JW Lua 0.29 / Finale 2014c / Windows 7.<br>
    <br>
    And another question in this context:<br>
    I don't understand the meaning of "preset/custom" here.<br>
    I thought that a glissando would be a preset shape as it is one of
    the <a class="el"
href="http://www.finaletips.nu/frameworkref/group__lua__classes.html#ga29b94a28426154f61cb5bf57d14a8b42">SMARTSHAPE_TYPES</a>.<br>
    But it only appears as a glissando in the score, if I also set the
    correct LineID which<br>
    is defined as "Returns the line style ID for <i>custom </i>smart
    shapes."<br>
    So what is a preset / custom in this context ? And does
    SetPresetShape(true) have any meaning here ?<br>
    <br>
    Thanks a lot for your hints in advance !<br>
    <br>
    Best regards,<br>
    Jan<br>
    <br>
    <br>
    for e in eachentrysaved(finenv.Region()) do<br>
        if (e.MeasurePos==0) and (e.Measure==1) then --first note on
    measure pos 0 in measure 1<br>
            for e2 in eachentrysaved(finenv.Region()) do<br>
                if (e2.MeasurePos==2048) and (e2.Measure==1) then
    --second note on measure pos 2048 in measure 1<br>
    <br>
                    --create glissando smartshape and attach it to e and
    e2<br>
                    local smartshape = finale.FCSmartShape()<br>
                   
    smartshape:SetShapeType(finale.SMARTSHAPE_GLISSANDO)  <br>
                    smartshape:SetEntryBased(true)<br>
                    smartshape:SetPresetShape(true) <br>
                    smartshape:SetVisible(true)<br>
                    smartshape:SetLineID(1)<br>
                    smartshape:SetEntryAttachedFlags(true)<br>
    <br>
                    local leftseg = smartshape:GetTerminateSegmentLeft()<br>
                    leftseg:SetMeasure(e.Measure)<br>
                    leftseg:SetStaff(e.Staff)<br>
                    leftseg:SetEndpointOffsetX(0)<br>
                    leftseg:SetEndpointOffsetY(0)<br>
                    leftseg:SetControlPoint1OffsetX(0)<br>
                    leftseg:SetControlPoint1OffsetY(0)<br>
                    leftseg:SetControlPoint2OffsetX(0)<br>
                    leftseg:SetControlPoint2OffsetY(0)<br>
    <br>
                    local rightseg =
    smartshape:GetTerminateSegmentRight()<br>
                    rightseg:SetMeasure(e2.Measure)<br>
                    rightseg:SetStaff(e2.Staff)<br>
                    rightseg:SetEndpointOffsetX(0)<br>
                    rightseg:SetEndpointOffsetY(0)<br>
                    rightseg:SetControlPoint1OffsetX(0)<br>
                    rightseg:SetControlPoint1OffsetY(0)<br>
                    rightseg:SetControlPoint2OffsetX(0)<br>
                    rightseg:SetControlPoint2OffsetY(0)<br>
    <br>
                    smartshape:SaveNewEverything(e,e2) <br>
                end<br>
             end<br>
         end<br>
    end<br>
    <br>
  </body>
</html>