BookmarkSubscribeSubscribe to RSS Feed
jsuls

Community Trekker

Joined:

Jul 30, 2014

Contour Plot with VB Automation

Hey, I am trying to create a contour plot from a data table using VB automation. I need to specify to "Fill Areas" and set the maximum and minimum contour levels. Thanks

Here is what I have so far. I keep getting a runtime error 438 for the line "Set con = jmpdoc1.CreateContour"

Sub JMP()

    Dim jmpdoc1 As JMP.Document

    Dim myJMP As JMP.Application

   

    Dim DT As JMP.DataTable

   

    Set myJMP = CreateObject("jmp.application")

    myJMP.Visible = True

    Set jmpdoc1 = myJMP.OpenDocument("C:\Users\jsuls\Desktop\test.csv")

    Set DT = jmpdoc1.GetDataTable

   

  

Dim con As JMP.Contour

Set con = jmpdoc1.CreateContour

            con.LaunchAddY ("Z")

            con.LaunchAddX ("X")

            con.LaunchAddX ("Y")

            con.FillAreas (True)

            con.SpecifyContours(5.0,20.0,6.0,True)

            con.Launch

                          

End Sub

1 ACCEPTED SOLUTION

Accepted Solutions
briancorcoran

Joined:

Jun 23, 2011

Solution

Re: Contour Plot with VB Automation

Sorry, for some reason I didn't get a notification of a reply.  The call in Automation to create a Contour Plot is CreateContourPlot, not CreateContour.  Do you have CreateContourPlot?

3 REPLIES
briancorcoran

Joined:

Jun 23, 2011

Re: Contour Plot with VB Automation

For text files, you must use the text import interface to automation.  The Text Import sample application in your Samples Automation folder gives an example.  For JMP 11, the location would be something like C:\Program Files\SAS\JMP\11\Samples\Automation\Visual Basic Samples\Text Import .NET.

If you open that example, you will see that a typical sequence to open a CSV file would be something like:

        Dim TI As JMP.TextImport

        TI = MyJMP.CreateTextImportObject("c:\program files\sas\jmp\11\samples\import data\Book1.csv", 10000)

        TI.SetEndOfFieldOptions(JMP.jmpTIEndOfFieldConstants.tiComma)

        TI.SetEndOfLineOptions(JMP.jmpTIEndOfLineConstants.tiCRLF)

        TI.FirstLineIsData(True)

        Doc = TI.OpenFile()

Highlighted
jsuls

Community Trekker

Joined:

Jul 30, 2014

Re: Contour Plot with VB Automation

The problem isn't opening the csv file. I can open it with the code above. The problem is generating the contour plot. I can create distributions, surface plots, etc. using this vb code. The only problem that occurs is when I try to create a contour plot. I keep getting the "object doesn't support this property or method" error message

briancorcoran

Joined:

Jun 23, 2011

Solution

Re: Contour Plot with VB Automation

Sorry, for some reason I didn't get a notification of a reply.  The call in Automation to create a Contour Plot is CreateContourPlot, not CreateContour.  Do you have CreateContourPlot?