DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Map generated by the script and transfered into REPORT

Hello everybody.

 

I am wondering whether it is possible to use a script to generate a map in VIEW with our test route, transfer it to REPORT and then set the "Keep aspect ratio" setting for the map object? I found a script for the transfer between the VIEW and REPORT here on the forum but the rest keeps a mystery for me. I tried to record a script via Macro Recording tool when doing this process in GUI but I got only 

call View.Sheets("Sheet 1").Areas("Area : 1").SplitLeft("",-1)
View.Sheets("Sheet 1").Areas("Area : 2").DisplayObjType = "Map"
' Call WndShow("VIEW")
Call ScriptStart("C:\PROGRAM FILES\NATIONAL INSTRUMENTS\DIADEM 2020\Resource\VwLayTrans", "VWTransViewRep", False)

 Can you please help how to select channels for longitude, latitude, how to select zoom level and so on?

 

Thank you

 

Marek

0 Kudos
Message 1 of 2
(80 Views)

Hi Marek,

 

You need to programmatically set the Map properties while it's still in VIEW, because what gets transported over to REPORT is just an image of the current map area state.  Then in REPORT you can programmatically set any image properties you want, such as original aspect ratio, like this:

Set Sheet = View.Sheets(1)
Set Area = Sheet.Areas(3)
Set Map = Area.DisplayObj
AreaName = Area.Name
Map.MapType = "Cache"
Map.ZoomLevel = 17
Map.ShowTrack = True
Map.MapMovingMode = "Pan"
Map.UseCache = True
Map.CachePath = "\Examples\Documents\MapCache\"
Map.SynchronisationChannelName = "[1]/TimeStamp"
Map.LongitudeChannelName = "[1]/Longitude"
Map.LatitudeChannelName = "[1]/Latitude"
Map.ColorChannelName = "[2]/Speed"
Map.SynchronisationDimension = "X-Cursor"
Map.LongitudeDimension = "Y-Cursor"
Map.LatitudeDimension = "Z-Cursor"

Call ScriptStart(ProgramDrv & "Resource\VwLayTrans", "VWTransViewRep", False)

Set Sheet = Report.Sheets(Report.Sheets.Count)
Set Image = Sheet.Objects(AreaName)
Image.UseOriginalRatio = TRUE

 

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 2 of 2
(36 Views)