Contour Plot with VB Automation<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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
Re: Contour Plot with VB AutomationSorry, 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?
Re: Contour Plot with VB AutomationThe 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
Re: Contour Plot with VB AutomationFor 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()