Applying graphics settings in a macro from 3-D surface plot - Statistica Visual Basic - Statistica - Dell Community

Applying graphics settings in a macro from 3-D surface plot

Applying graphics settings in a macro from 3-D surface plot

This question is not answered

I can create macros successfully for a 3-D surface graph using the menu Graph->3D XYZ Graphs->Surface plots (I am using a German version, so please excuse me, if the translation deviates from the English version).
The active dataset is the dataset Exp.sta. I create a Spline using the variables X = Time, Y = Stress, Z = Correct1. I then create the macro using Options->Create Macro in the dialog box.
The graph created in the macro can then be displayed by adding the line:
oGD1.Graphs(1).Visible = True

Then the 3-dimensional surface plot appears, when I run the macro.

Now, what I also want to do in the macro is the following:
Click with the right mouse on the graph. Select the context menu item Graph Properties (All Options).
Open the tab "Surfaces". In the grouping on the tab above, "Number of divisions for surfaces", deselect the "X = Y" check box and set the X value to 10, say, and the Y value to 15. Click on OK, then the graph surface shows 10 lines from the X-axis and 15 lines from the Y-axis. This works fine with the dialog box, but I cannot get it to work at all in the macro, which I created above.

I cannot find a property for the "X = Y" check box. The properties Layout3DScatterplot.SurfaceXCuts and Layout3DScatterplot.SurfaceYCuts seem to be those that are set as above in the dialog box All Options, but they do not change the graph from X = 20 and Y = 20, after I set them in the macro in this way:
'Add a reference to STATISTICA Graphics Type Library
Dim thisLayout As Layout3DScatterplot
Set thisLayout = oGD1.Graphs(1).Content
thisLayout.SurfaceXCuts = 10
thisLayout.SurfaceYCuts = 15
oGD1.Graphs(1).Visible = True

How can I get the macro to apply these changes like in the All Options dialog box?

 

kenneth52

All Replies
  • Kenneth

    You need to grab the graph object before making your changes, then output the modified version. Try this:

    Dim g As Graph
    Dim thisLayout As Layout3DScatterplot

    Set g=oGD1.Graphs(1)
    Set thisLayout=g.Content

    thisLayout.SurfaceXCuts=10
    thisLayout.SurfaceYCuts=15
    newanalysis.RouteOutput(g).Visible = True

    Hope this helps

    Matt Coates

  • Matt

    Thanks a lot!!!

    Your suggestion works. I also am able to apply it from MS Access.

    Cheers

    Kenneth

     

    kenneth52