import clr clr.AddReference('DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool') from DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool import * def ImportNetCDF(): """ """ # set parameters filePath = "C:\Mike_InportNetcdf_works.nc" coordinateSystem = "WGS 84" targetRasterGroup = "/NetCDF Import files" # prepare inputs gismod = app.Modules.Get("GIS Manager") for cSystem in gismod.CoordinateSystemList.GetAll(): if (cSystem.Name == coordinateSystem): coordinateSystem = cSystem; break; rasterGroup = gismod.RasterGroupList.Fetch(targetRasterGroup) # run tool tool = app.Tools.CreateNew('Import from NetCDF file') tool.InputItems.Add(rasterGroup) tool.CoordinateSystem = coordinateSystem tool.RasterGroupName = targetRasterGroup tool.FilePath = filePath tool.Execute()