Welcome to Golden Software Support

Set rectangle to a position

Comments

3 comments

  • Official comment
    Avatar
    Brittany Bodane

    Hi André,

    Thank you for posting your question. The reason the objects appear to be placed based off of inches rather than centimeters is because you are missing the line of script that actually sets the page units to centimeters.

    For an example see below:

    If adding this line does not resolve the issue, please let me know.

    Thanks,

    Brittany Bodane

    Golden Software

    Comment actions Permalink
  • Avatar
    André Niemeijer

    Hi  Brittany,

     

    Thanks for your reaction. Unfortunuatly the line that you suggested to add, was already in the script. You can see it in the code I already sended.

    It seems that return-values from left, and top are in centimeters. The return-values from width and height are in inches!

    On the moment that I set the left and top internally something strange seems to happen.

    For now I ovecome the problem through working with inches as pageunits. Than I convert the desired position from centimeters to inches. Also for the line-style-thickness I have too do the unit-conversion. In this way I get by scripting the desired positions. In this way I can align for example a legend on top of a graph (graph.top = legend.top - legend.height).

    Hopefully you can resolve the problem.

    André Niemeijer

    0
    Comment actions Permalink
  • Avatar
    Brittany Bodane

    Hi André,

    Thank you for sending additional information. The printed lines you are calling out state that the page units are set to inches; this is what the 1 in PageUnits = 1 stands for. You can find this information in Grapher's Help on the grfPageUnits page. grfInches is listed first, making its value 1.

    I do not see the line I recommended you add in the original snippet of script you sent, or the additional screenshot. You have called the property, but have not set it. This is why your units are appearing in inches. To set the page units to centimeters, you will need to add the following line:

    PlotWindow.PageUnits = grfCentimeters

    In the portion you sent, I only see:

    Plot.Windows.Item(1).PageUnits(grfCentimeters)

    The recommended line should appear after this as shown in my previous response.

    If you need further help, please send the entire script (.BAS) file and at least one data file that goes along with the script to support@goldensoftware.com so we can help point you in the right direction. 

    Thank you,

    Brittany Bodane

    Golden Software

    0
    Comment actions Permalink

Please sign in to leave a comment.