sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Coords Text Tag from Datum

    Scheduled Pinned Locked Moved Plugins
    148 Posts 26 Posters 98.6k Views 26 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • GaieusG Offline
      Gaieus
      last edited by

      @tig said:

      So.... is it 'broken' ?
      And if it is what do I [we] need to do to fix it ?? 😕

      No, it works perfectly. Just swap the Longitude and Latitude texts in the dialog. This way it is misleading because we need to enter the values swapped.

      This (line 799-803):

      <span class="syntaxdefault">    if xyunits</span><span class="syntaxkeyword">==</span><span class="syntaxstring">"Latitude_Longitude"<br /></span><span class="syntaxdefault">      p0</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"Longitude; "<br /></span><span class="syntaxdefault">      p1</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"Latitiude; "<br /></span><span class="syntaxdefault">      xyus</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"LL"<br /></span><span class="syntaxdefault">    else<br /> </span>
      

      should be

      <span class="syntaxdefault">    if xyunits</span><span class="syntaxkeyword">==</span><span class="syntaxstring">"Latitude_Longitude"<br /></span><span class="syntaxdefault">      p0</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"Latitude; "<br /></span><span class="syntaxdefault">      p1</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"Longitude; "<br /></span><span class="syntaxdefault">      xyus</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"LL"<br /></span><span class="syntaxdefault">    else<br /> </span>
      

      "Latit iude" is misspelt there anyway (good it was not in the code - although then it would have turned out at least - and I could hardly find it as I did not notice the misspell first and was also searching for "Latitude" in NP++) so it could bear an update.
      😉

      Gai...

      1 Reply Last reply Reply Quote 0
      • GeorgeG Offline
        George
        last edited by

        That solved that problem, Gaieus. 😍

        Now to try this on the ‘Import Coords-Tags from CSV’ tool.

        Note the coordinates entered in the dialog are the reverse of those in Model Info-Location
        Yet, the LL-Tag it creates is correct.

        http://lh3.ggpht.com/_pI3lDYnW_xk/TTt43VeSnEI/AAAAAAAAD8g/r2plRMUotD4/ScreenShot111.jpg

        -Geo

        "Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan

        1 Reply Last reply Reply Quote 0
        • GaieusG Offline
          Gaieus
          last edited by

          Oh, I am really glad. When I was torturing TIG along this whole topic until we got where the plugin is, I mainly concentrated on the other aspects of it (custom, ortho-co-ordinates) as Didier by then had come out with his LatLong tool and in this plugin here it was just an "extra" for me (but of course, important one) so did not notice this little glitch.

          Anyway, I hope you enjoy it as much as I do (and of course, many thanks to TIG again)
          👍


          I think in that Help Forum topic I overcomplicated the thing with the PhotoMatch thing as the guy does not seem to need it as accurately.

          Gai...

          1 Reply Last reply Reply Quote 0
          • GaieusG Offline
            Gaieus
            last edited by

            OK, so I went along and did the changes in the code I wrote above and success; it works perfectly!

            Gai...

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              Here's an update http://forums.sketchucation.com/viewtopic.php?p=284829#p284829
              It should now work ! as Gaieus explained the prompts were wrong 😒 .
              At least I've got him to delve into the bowels of a script AND fix it himself!!
              We'll make a scripter of you yet Csaba!!!

              I fixed the typo in the 'Add' dialog prompts' text.
              I've also add +/- clues in them to avoid users West of Greenwich getting confused by Longitude!
              Also now the 'Add' dialog's values of the Lat/Long start off with the model's origin Lat/Long and thereafter use the last used values...

              TIG

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                @george said:

                @gaieus said:

                OK, so I went along and did the changes in the code I wrote above and success; it works perfectly!

                OK. I’ll change the code and report back.

                Perhaps that is also what is causing the problem with ‘Import Coords-Tags from CSV’. ❓
                The script will export LL-tags to CSV file perfectly.
                Nothing happens when I try to import a CSV file in LL units.

                I’ve tried importing CSVs I created and I’ve tried importing one of the CSVs the script exported.
                Neither CSV will work. I also tried reversing Latitude and Longitude in the CSV file. Niente. 😞

                ‘Import Coords-Tags from CSV’ does work if I specify length units and not LL

                -Geo

                Geo - no need to change the code - get v1.7, it's fixed!!!

                'Import Coords-Tags from CSV'
                This imports all of the 'Coords-Tags' into the Model from a CSV file in
                to format X,Y,Z or LAT,LONG,Z - the values must be comma separated and
                consist of numerals only with '.' as the decimal separator, one point
                per line.
                A dialog then requests the 'units' used in the CSV file for XY and Z,
                and if you want to add Cpoints [defaults are 'm' and 'Yes'].
                If the CSV file has a 'header' line etc it is ignored.
                Is this what you are doing ?

                TIG

                1 Reply Last reply Reply Quote 0
                • GeorgeG Offline
                  George
                  last edited by

                  @gaieus said:

                  OK, so I went along and did the changes in the code I wrote above and success; it works perfectly!

                  OK. I’ll change the code and report back.

                  Perhaps that is also what is causing the problem with ‘Import Coords-Tags from CSV’. ❓
                  The script will export LL-tags to CSV file perfectly.
                  Nothing happens when I try to import a CSV file in LL units.

                  I’ve tried importing CSVs I created and I’ve tried importing one of the CSVs the script exported.
                  Neither CSV will work. I also tried reversing Latitude and Longitude in the CSV file. Niente. 😞

                  ‘Import Coords-Tags from CSV’ does work if I specify length units and not LL

                  -Geo

                  UPDATE

                  @unknownuser said:

                  I’ll change the code and report back.

                  I'll load the new version and report back. 😉

                  "Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan

                  1 Reply Last reply Reply Quote 0
                  • GaieusG Offline
                    Gaieus
                    last edited by

                    Well, I am really glad we could iron this out. I am still thinking on some possible, extra features but enough for today (and this week-end).

                    TIG: if the error had been in the codeitself, I would've never been able to find it so let's just forget that scripter apprenticeship! This was just a lucky trial and error (and I got suspicious because one regularly needs to add the Lat datum first and the Lon datum second although this is merely a convention of course)
                    😄

                    Gai...

                    1 Reply Last reply Reply Quote 0
                    • GeorgeG Offline
                      George
                      last edited by

                      @tig said:

                      Geo - no need to change the code - get v1.7, it's fixed!!!

                      Got it. 👍

                      Success!!!
                      The 'Add Coords-Tag by Dialog' tool now places LL-Tags perfectly.

                      @tig said:

                      'Import Coords-Tags from CSV'
                      This imports all of the 'Coords-Tags' into the Model from a CSV file in
                      to format X,Y,Z or LAT,LONG,Z - the values must be comma separated and
                      consist of numerals only with '.' as the decimal separator, one point
                      per line.
                      A dialog then requests the 'units' used in the CSV file for XY and Z,
                      and if you want to add Cpoints [defaults are 'm' and 'Yes'].
                      If the CSV file has a 'header' line etc it is ignored.
                      Is this what you are doing ?

                      Yes.
                      Still, no success with v1.7 when I try importing a CSV in LL/Z units.

                      And …

                      Only partial success importing a CSV in XYZ length units.
                      I’m testing 'Import Coords-Tags from CSV' in XYZ length units with a simple CSV file.
                      I shared the CSV file at Google Docs:

                      https://spreadsheets.google.com/ccc?key=0AqR273kvdPGOdGhhWnJ6cTAyUDNZRExWYnc1YXk2emc&hl=en&authkey=CMLQqZYD

                      In the image below: Only 7 tags were created from the CSV file containing 49 points.
                      The 8th cords-tag you see in the image (at the origin) was placed prior to CSV import.

                      http://lh5.ggpht.com/_pI3lDYnW_xk/TTxYx-GVdPI/AAAAAAAAD80/65FlXWz5zBk/ScreenShot112.jpg

                      I’m fairly certain there is no problem is with the CSV file as I can import the file with the version of ‘Import Points Cloud’ script I’m running and all 49 points appear as in the image below.

                      The points in the CSV file describe the vertices of a cylinder with 24 segments (48 points)
                      The 49th point in the CSV file is at the origin [0,0,0]

                      http://lh3.ggpht.com/_pI3lDYnW_xk/TTxYyKHaoWI/AAAAAAAAD84/pZjMRqUHWkQ/ScreenShot113.jpg

                      I’ve been methodically trying different combinations of settings in the script settings dialog, to no avail.

                      Perhaps if we (or is it just me who's fouled up) manage 'Import Coords-Tags from CSV' in simple XYZ length units to work, then we’ll (I'll) be able to figure out the process using XY=LL/Z=Feet. 😕

                      Many thanks for your efforts, TIG.

                      -Geo

                      "Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        Geo

                        Can you zip and post your 'problem' CSV file so I can try it - telling me the 'units' [feet?]....

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • GeorgeG Offline
                          George
                          last edited by

                          Hi TIG,

                          Here is: Points Test.zip

                          Error 404 (Not Found)!!1

                          favicon

                          (docs.google.com)

                          The units were inches @ 6 dp

                          -Geo

                          "Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan

                          1 Reply Last reply Reply Quote 0
                          • TIGT Offline
                            TIG Moderator
                            last edited by

                            @george said:

                            Hi TIG,

                            Here is: Points Test.zip

                            Error 404 (Not Found)!!1

                            favicon

                            (docs.google.com)

                            The units were inches @ 6 dp

                            -Geo

                            Thanks, I'll have a look at it - by the way you attach modestly sized zips etc like this direct to your posts... 😕

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • TIGT Offline
                              TIG Moderator
                              last edited by

                              Here's an updated version http://forums.sketchucation.com/viewtopic.php?p=284829#p284829
                              v1.8 - Typos in Import-CSV fixed to allow -ve values, z=0 & no z.
                              I had some stupid code errors that meant that xyz values with any negative numbers were skipped and also they were getting skipped if z didn't exist or was 0 😒
                              Now all fixed... 😄

                              George - your CSV now works perfectly! two 24 point circles one above the other, and one cpoint at the origin - 49 in all...

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • GeorgeG Offline
                                George
                                last edited by

                                @tig said:

                                .... by the way you attach modestly sized zips etc like this direct to your posts... 😕

                                Forgive me, TIG.

                                We do not have such modern conveniences over at Google SketchUp Help Forum. 😳

                                -Geo

                                "Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan

                                1 Reply Last reply Reply Quote 0
                                • GeorgeG Offline
                                  George
                                  last edited by

                                  @tig said:

                                  Here's an updated version v1.8 ... Now all fixed... 😄

                                  George - your CSV now works perfectly! two 24 point circles one above the other, and one cpoint at the origin - 49 in all...

                                  😍 Yes !!!

                                  The CSV import in LL/Z units works perfectly as well !!!

                                  I'll alert the OP in the GSHF thread ... where all this commotion started. 😒

                                  Thank you, TIG. You are the master 🤓

                                  Thanks to Gaieus also. 😄

                                  -Geo

                                  "Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan

                                  1 Reply Last reply Reply Quote 0
                                  • GaieusG Offline
                                    Gaieus
                                    last edited by

                                    Many thanks for this update, TIG!
                                    (and Geo, for being so persistent!)
                                    ☀

                                    Gai...

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      tomasz
                                      last edited by

                                      Thanks for the plugin!
                                      When I set XY units to <None> I get following report in the Ruby Console:

                                      Error; #<TypeError; nil can't be coerced into Float>
                                      C;/Program Files/Google SketchUp 8/Plugins/#coordstexttagtoolfromdatum.rb;291;in `*'
                                      C;/Program Files/Google SketchUp 8/Plugins/#coordstexttagtoolfromdatum.rb;291;in `units'
                                      C;/Program Files/Google SketchUp 8/Plugins/#coordstexttagtoolfromdatum.rb;493;in `settings'
                                      C;/Program Files/Google SketchUp 8/Plugins/#coordstexttagtoolfromdatum.rb;1209
                                      

                                      Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

                                      1 Reply Last reply Reply Quote 0
                                      • TIGT Offline
                                        TIG Moderator
                                        last edited by

                                        Tomasz

                                        Here's v1.9 http://forums.sketchucation.com/viewtopic.php?p=284829#p284829
                                        I think I fixed the typo glitches that messed up the <None> options... 😒

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • U Offline
                                          ubi904
                                          last edited by

                                          Is it possible to change at least one point coordinate to the real wgs84 coordinate? And after it all coordinates will be exported relative to this georefareted point??

                                          1 Reply Last reply Reply Quote 0
                                          • TIGT Offline
                                            TIG Moderator
                                            last edited by

                                            You set a datum and that fixes [0,0,0] as what you've entered ?
                                            I'm unsure I understand you otherwise ??

                                            TIG

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 4 / 8
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement