TBC Macros and Extensions

 View Only
Expand all | Collapse all

bug and fix for "surface to pts", "surface to grid" and macros with intermediate list files

  • 1.  bug and fix for "surface to pts", "surface to grid" and macros with intermediate list files

    Posted 11-14-2019 08:45

    I always got an encoding error running those macros.

    I chased it down to the use of the wrong separator. On computers with english region settings the "digit grouping symbol" and the "list separator" are usually the same character a comma. But for most other countries they differ from each other and we need to use the latter.

     

    The "digit grouping symbol" is in our case the character '

    And that naturally messes up the assembly of the output string since it is also limited by them. You would have to double encapsulate them, or something like that, to make it work.

     

    In both macros I replaced

    c = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator

     

    with

    c = CultureInfo.CurrentCulture.TextInfo.ListSeparator



  • 2.  Re: bug and fix for "surface to pts", "surface to grid" and macros with intermediate list files

    Posted 11-14-2019 14:27

    Good catch. I will update the effected macros.



  • 3.  Re: bug and fix for "surface to pts", "surface to grid" and macros with intermediate list files

    Posted 11-18-2019 01:18

    Thanks Gary. There still seems to be a small bug in "Surface to grid" if you don't want to export a file.

    Haven't had time yet to further look into it.



  • 4.  Re: bug and fix for "surface to pts", "surface to grid" and macros with intermediate list files

    Posted 12-02-2019 10:27

    I updated macro to give warning if neither export option selected (since in that case the macro would do nothing)