Displaying the results of script execution

Print Previous page Top page Next page

When processing a large number of objects, the script can display a progress bar with the percentage of completion, the name of the operation, the number of processed objects, the elapsed and remaining time (time information is generated automatically).

 

script_exec

 

         if seekcount > 1000:

             hprogress = mapapi.mapOpenProgressBar()

     ...

             if hprogress != 0:

               ret = mapapi.mapProgressBar(hprogress, int(percent), mapsyst.WTEXT(' Сдвиг объектов: ' +

                            mapapi.IntToStr(objcount) + '/' + mapapi.IntToStr(seekcount)))

 

               if ret == -1:

                   break

   ...

       if hprogress != 0:

           mapapi.mapCloseProgressBar(hprogress)

 

The value that is returned from the function called in the script is displayed in the dialog box in the Result field.

 

script_exec2

 

      def mapAddHValue(hmap:maptype.HMAP, hobj:maptype.HOBJ) -> float:

          if hmap == 0:

             return 0

      ...

 

          mapapi.mapShowMessage(mapsyst.WTEXT('Обработано объектов - ' + str(readycount)),

                                                       mapsyst.WTEXT('Добавление высоты в метрику'))

          return readycount

 

To display a tooltip that goes out after a few seconds and record the executed command in the session log, use the mapapi.mapShowMessage function.