5 Replies Latest reply on Oct 30, 2015 3:56 AM by Jump_Over

    Get height of page items using reference point

    aviR Level 1

      Hello all

      Can anyone tell me how to get the geometric bounds of a page item using reference point?

      Please help

      Thank you

        • 1. Re: Get height of page items using reference point
          Jump_Over Level 5

          Hi,

           

          geometricBounds property is reffered to document.zeroPoint


          Whats your goal?

           

          Jarek

          • 2. Re: Get height of page items using reference point
            aviR Level 1

            My goal is:

            When i set the reference point in to document to any point ex:- topleftcorner

            then i should get the X and Y value of the selected page item.

             

            How can I do this?

            • 3. Re: Get height of page items using reference point
              Jump_Over Level 5

              there is no such property like X and Y for object.

               

              Object.geometricBounds is an array of y,x,Y,X coordinates for object's corners regarding to zeroPoint.

              LeftUp corner is Object.geometricBounds[1] (for x) and Object.geometricBounds[0] (for y).

               

              However if your goal is to check layoutWindow.transformReferencePoint and read relative object's bound point

              ==>

                   app.activeDocument.layoutWindows[0].transformReferencePoint will tell you which point is selected

               

              According to above you need to read some object.geometricBounds or calculate it (in case of center points)

               

              Jarek

              • 4. Re: Get height of page items using reference point
                aviR Level 1

                What I am doing is:

                setting the reference point like following

                app.ActiveWindow.transformReferencepoint = idAnchorPoint.idTopLeftAnchor

                After this I want to get the X and Y coordinates that is showing at the top of the indesign document below the menu bar.

                Are you getting my query?

                • 5. Re: Get height of page items using reference point
                  Jump_Over Level 5

                  Hi,

                   

                  If you set the reference point ==> you can read/calculate object relative values

                  I.e:

                  you set reference to AnchorPoint.TOP_LEFT_ANCHOR

                       so you can

                            read X value as object.geometricBounds[1] and

                            read Y value as object.geometricBounds[0]

                  you set reference to AnchorPoint.RIGHT_CENTER_ANCHOR

                       so you can

                            read X value as object.geometricBounds[3] and

                            calculate Y value as (object.geometricBounds[2] - object.geometricBounds[0] ) / 2

                   

                  Is here something unclear?

                   

                  Jarek