6 Replies Latest reply on Sep 1, 2010 10:17 PM by Yuliaart

    Corner options for line in InDesign CS5 js

    Yuliaart Level 1

      Hi, with CS5 update I am getting an error message the 'object  doesn't support property of the method cornerOptions' when I use code from CS4:

       

      myRoundCornerLeftBottomVerticalWhite = myDoc.graphicLines.add (myDoc.layers.item ("Die"));
      var myPathPoint = myRoundCornerLeftBottomVerticalWhite.paths.item(0).pathPoints.add (myDoc.layers.item ("Die"));
      myRoundCornerLeftBottomVerticalWhite.cornerOption = CornerOptions.ROUNDED_CORNER;
      myRoundCornerLeftBottomVerticalWhite.cornerRadius = myRadius;

       

      I am not sure what I can use instead.

       

       

      Thank you for your help.

      Yulia

        • 1. Re: Corner options for line in InDesign CS5 js
          [Jongware] Most Valuable Participant

          Check the OMV Help -- corner options changed from CS4 to CS5 from plain 'cornerOption' to topLeftCornerOption, topRightCornerOption, bottomLeftCornerOption, and bottomRightCornerOption. It's now possible to set each corner to another value, instead of having them all the same.

           

          You'll have to try to see what 'top left', 'bottom right' etc. mean for one single corner in a graphic line ...

          • 2. Re: Corner options for line in InDesign CS5 js
            Yuliaart Level 1

            I replaced it, and it doesn't complain any move, but it doesn't make corners round:

             

            myRoundCornerLeftBottomVerticalGreen = myDoc.graphicLines.add (myDoc.layers.item ("Die"));
            myRoundCornerLeftBottomVerticalGreen.geometricBounds = [myPageHeight/2+.0625, 0, myPageHeight,  0];
            myRoundCornerLeftBottomVerticalGreen.strokeColor = myDoc.colors.item("Proof");
            myRoundCornerLeftBottomVerticalGreen.strokeWeight = "1pt";
            
            var myPathPoint = myRoundCornerLeftBottomVerticalGreen.paths.item(0).pathPoints.add (myDoc.layers.item ("Die"));
            myPathPoint.anchor = [myPageWidth/2+.0625, myPageHeight];
            myRoundCornerLeftBottomVerticalGreen.bottomLeftCornerOption = CornerOptions.ROUNDED_CORNER;
            myRoundCornerLeftBottomVerticalGreen.bottomLeftCornerRadius = myRadius;
            
            

             

             

            I get myRadius from a dialog box, something like "1/4".

             

             

            Thank you for your help.

            Yulia

            • 3. Re: Corner options for line in InDesign CS5 js
              [Jongware] Most Valuable Participant

              xxCornerRadius expect a "measurement or string". The measurement should be a number, and I strongly suspect the string can only be one with a measurement unit tacked onto the end -- so try with 0.25, or alternatively "0.25pt".

              • 4. Re: Corner options for line in InDesign CS5 js
                Yuliaart Level 1

                No, even with ".25" or ".25 in" it still gave me square corners.

                 

                Thank you for your help.

                Yulia

                • 5. Re: Corner options for line in InDesign CS5 js
                  Marijan Tompa [tomaxxi] Level 4

                  Hey!

                   

                  You can't assign corner option to graphic line. You have to work it through path point options like: pointType, leftDirection, rightDirection. Take a look at OMV 'pathPoint' for more info. You will have to add one more point, and then with PointType.CORNER create round corner.

                   

                  corner.jpg

                   

                  --

                  tomaxxi

                  http://indisnip.wordpress.com/

                  • 6. Re: Corner options for line in InDesign CS5 js
                    Yuliaart Level 1

                    Ok, here is how far I got with it, but it's not working:

                     

                     

                    myRoundCornerLeftBottomVerticalWhite = myDoc.graphicLines.add (myDoc.layers.item ("Die"));
                    myRoundCornerLeftBottomVerticalWhite.geometricBounds = [myPageHeight/2+.0625, 0, myPageHeight-.25,  0];
                    myRoundCornerLeftBottomVerticalWhite.strokeColor = myDoc.colors.item("Black");
                    myRoundCornerLeftBottomVerticalWhite.strokeWeight = "2pt";
                    
                    var myPathPoint = myRoundCornerLeftBottomVerticalWhite.paths.item(0).pathPoints.add (myDoc.layers.item ("Die"));
                    myPathPoint.anchor = [".25 in", myPageHeight];
                    
                    var myPathPoint = myRoundCornerLeftBottomVerticalWhite.paths.item(0).pathPoints.add (myDoc.layers.item ("Die"));
                    myPathPoint.anchor = [myPageWidth/2-.0625, myPageHeight];
                    
                    
                    myRoundCornerLeftBottomVerticalWhite.paths[0].pathPoints[0].pointType.CORNER(CornerOptions.bottomLeftCornerOption = CornerOptions.ROUNDED_CORNER);
                    myRoundCornerLeftBottomVerticalWhite.bottomLeftCornerRadius = myRadius;
                    
                    

                     

                     

                    or maybe:

                     

                     

                    myRoundCornerLeftBottomVerticalWhite.paths[0].pathPoints[0].pointType.CORNER.cornerOptions.bottomLeftCornerOption = CornerOptions.ROUNDED_CORNER;

                     

                     

                    It works up to the point:

                     

                    myRoundCornerLeftBottomVerticalWhite.paths[0].pathPoints[0].pointType;

                     

                    The rest I am not sure how to connect.

                     

                    Thank you for your help.

                    Yulia