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

    [Plugin] KML Tools (2.0.0-beta) — updated 31.05.2013

    已排程 已置頂 已鎖定 已移動 Plugins
    137 貼文 49 Posters 124.4k 瀏覽 49 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Q 離線
      qpik
      最後由 編輯

      First of all thank you for the plugin.

      Have I just found a possible bug in kmlimport.rb, linestring method, line 422 - "<tesselated>" instead of "<tessellate>"?

      I'm learning how to model a terrain using my mobile's GPS and Sketchup. Since the Symbian app I use (GPSmap, http://www.vikinggames.hu/product.php?id=7) logs only CSV/KML Waypoints and additionally uses commas instead of points, so I have to manually convert the values. I'm new to KML (and I'm not a programmer) so the easiest way I noticed so far was to just put all the coords into a <LineString> tag, but in Sketchup the altitudes are wrong (i.e. flat or clamped to GE terrain).
      So I just go through your code and KML documentation to find a solution.

      Edit: which is as simple as adding <altitudeMode>absolute</altitudeMode> inside <LineString> tag.

      1 條回覆 最後回覆 回覆 引用 0
      • A 離線
        Aerilius
        最後由 編輯

        That looks indeed like a bug! Thanks for reporting!

        1 條回覆 最後回覆 回覆 引用 0
        • SygskyS 離線
          Sygsky
          最後由 編輯

          Hi! I'm interesting in follow - how this scripts should/could work at all?

          I installed it correctly (think so), restarted SketchUp, called menu of "KML Tools", pointed "Export KML file" item, spend some time to look at the modal dialog, at last clicked "Ok" button, created new export file name and what? Nothing occurs! No any file anywhere was created, no any messages typed, nothing. Module keeps silence 😮)

          I have last version of free license SketchUp downloaded yesterday.

          Thx in advance.

          1 條回覆 最後回覆 回覆 引用 0
          • TIGT 離線
            TIG Moderator
            最後由 編輯

            Do you have permission to write files to the destination folder ?
            Try your Desktop...
            Is there any exportable geometry in the SKP you are trying to export... etc ?

            TIG

            1 條回覆 最後回覆 回覆 引用 0
            • SygskyS 離線
              Sygsky
              最後由 編輯

              @tig said:

              Do you have permission to write files to the destination folder ?
              Try your Desktop...
              Is there any exportable geometry in the SKP you are trying to export... etc ?
              Yes, yes, yes and yes all times 😎 But suddenly I found the solve. Don't sure what was an origin for the problem, so only describe result:

              Rubi is not one of my multiple languages but throw the code I found that in some checks if any external/internal functions in module return nil, it exits without warnings. As last action I did is a file name pointing, I tried to set full file path manually in the input dialog field, e.g. "C:\Temp\1.kml", not only name as it show in system dialog itself ("1.kml"). And it worked! So as I can suppose, alone file name is used internally to be used with some standard prefix of directory different from one used in a real path, use din dialog.
              Why? Windows 64b 7 Professional and Rubi pair knows only/ So export problems is solved. Let me check import ones in next time 😮)

              Thx for the wishes to help for this small problem!

              1 條回覆 最後回覆 回覆 引用 0
              • K 離線
                KentD
                最後由 編輯

                Hi Aerilius

                I´ve used your plugin now and it seems to really work.

                I have to export a whole modeled city and I want them to be separate models.

                Your plugin does the trick! I make components of every and each model an export them.
                BUT if I have to ROTATE any of my models they will be exported randomly(it seems) and NOT in their right position.

                Any good suggestion how to deal with this?
                Regards
                KentD

                1 條回覆 最後回覆 回覆 引用 0
                • A 離線
                  Aerilius
                  最後由 編輯

                  The plugin should consider the rotation of the group's/component's bounding box.
                  If the group is rotated, the rotation will appear as a "heading" attribute in the KML file, while the Collada file contains the group's inner coordinate system. At least it should work that way. Can you send (pm) me a file where it doesn't work that way?

                  1 條回覆 最後回覆 回覆 引用 0
                  • S 離線
                    SBMattingly
                    最後由 編輯

                    When using this tool that I just downloaded, I get a small window first that says "Loading correct elevation data failed. Internet Explorer 8 (or higher) required." I have IE 8 and SU 8.

                    Ruby console says the following: "fetching elevation from url: http://api.geonames.org/astergdemJSON?formatted=true&lat=37.355313&lng=-108.385784&username=demo&style=full&callback=returnJson
                    returned:
                    {"status":{"message":"the deaily limit of 30000 credits for demo has been exceeded. Please use an application specific account. Do not use the demo account for your application.","value":18}}

                    Please help. I would love for this plugin to work.

                    Stan

                    1 條回覆 最後回覆 回覆 引用 0
                    • H 離線
                      humbertoanastasia
                      最後由 編輯

                      Hi there! Thanks for the plugin.

                      I'm having an issue, though.

                      I try to export an object, the dialog box opens, everything ok, and then...
                      Sketchup and the plugin just stop working.
                      Any ideas??

                      Tanhks!

                      1 條回覆 最後回覆 回覆 引用 0
                      • A 離線
                        Aerilius
                        最後由 編輯

                        What happens? What does "stop working" do?
                        And it's good if you tell me the file size, as described anything larger than some hundred kilobytes will take long. There is no simple way to make it faster.

                        1 條回覆 最後回覆 回覆 引用 0
                        • H 離線
                          humbertoanastasia
                          最後由 編輯

                          Thanks for the reply.

                          In fact, after I read your post, I tried "cleaning" the file, and minimizing it to the sole part of the model i wish to export. And... It worked out fine!

                          Thanks, and congratulations on your job!

                          1 條回覆 最後回覆 回覆 引用 0
                          • coda13C 離線
                            coda13
                            最後由 編輯

                            thank you very much!

                            1 條回覆 最後回覆 回覆 引用 0
                            • A 離線
                              Aerilius
                              最後由 編輯

                              **@thomthom said:

                              You're using a webdialog for the import - you can use the XML parsing capabilities of the web-browser:
                              http://www.w3schools.com/xml/xml_parser.asp
                              **

                              I'm working on a solution with a DOM xml parser.
                              It's more than 5 times faster than REXML (and probably much more in newer browsers). 😍

                              1 條回覆 最後回覆 回覆 引用 0
                              • A 離線
                                Aerilius
                                最後由 編輯

                                A quick update for compatibility with SketchUp 2013. It was released so quickly.
                                This is the last version before 2.0

                                1 條回覆 最後回覆 回覆 引用 0
                                • A 離線
                                  Aerilius
                                  最後由 編輯

                                  I have uploaded a beta version of KML Tools 2.0!
                                  If you like, please help testing and give me feedback if files don't work with it.
                                  The new version has

                                  • significant speed improvements, up to 7× faster import
                                  • a reliable xml parser and better support for nested kml structures
                                  • better error handling
                                  1 條回覆 最後回覆 回覆 引用 0
                                  • K 離線
                                    kubark42
                                    最後由 編輯

                                    Just tried the beta, but it made no file output, just an empty directory. 1.4 works fine for me with the same workflow, so I'm either doing something wrong or it's not working on my model.

                                    EDIT: Sorry, I should have included some info. This is OSX 10.8 running SU8. Model can be downloaded from https://www.dropbox.com/s/q5a1hzqvcwlc39u/Geo-fence.skp

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • K 離線
                                      kubark42
                                      最後由 編輯

                                      So this tool is really awesome, and almost exactly what I need. Thanks a million!

                                      Time for a tiny bug report: when setting the altitude mode to absolute altitude, instead of adjusting the Z values to the true altitudes, the script just sets the altitudeMode field to "absolute". The result is that a model that was drawn on the surface is buried in the ground in Google Earth.

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • A 離線
                                        Aerilius
                                        最後由 編輯

                                        Thanks for the feedback! I'll check your file and fix it.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • K 離線
                                          kubark42
                                          最後由 編輯

                                          Okay, figured out the second bug, and why I wasn't seeing it before:

                                          
                                              if facecolor
                                                @out.puts "  <Style>"
                                                @out.puts "    <LineStyle>"
                                                @out.puts "      <color>#{linecolor}</color>"
                                                @out.puts "      <colorMode>normal</colorMode>"
                                                @out.puts "      <width>1</width>"
                                                @out.puts "    </LineStyle>"
                                                @out.puts "    <PolyStyle>"
                                                @out.puts "      <color>#{facecolor}</color>"
                                                @out.puts "      <colorMode>normal</colorMode>"
                                                @out.puts "      <fill>1</fill>"
                                                @out.puts "      <outline>1</outline>"
                                                @out.puts "    </PolyStyle>"
                                                @out.puts "  </Style>"
                                                @out.puts "  <MultiGeometry>"
                                              end
                                          
                                          

                                          only places the <MultiGeometry> tag if there is a facecolor. So moving " @out.puts " <MultiGeometry>"
                                          " to right after the "end" solves the problem.

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • K 離線
                                            kubark42
                                            最後由 編輯

                                            Hi, Aerilius--

                                            I found out why I was having altitude problems. I don't program in ruby, but it looks close enough to other languages iI do program that I was able to muddle through it and realize that Altitude is not an attribute in GeoReference, so get_attribute("GeoReference","Altitude") returns 0. By changing Altitude to ZValueCentered, I was able to get a negative value in inches that is seemingly correct for my elevation. I cannot find a definitive reference on this, and there is also ModelTranslationZ which has the identical value for me, so I'm unclear which is the appropriate way forward. However, both solve my problem. So in conclusion, I've replaced line 253 by @ground = -@model.get_attribute("GeoReference","ZValueCentered").to_f.to_m and that solved my problem.

                                            Now I'm struggling with an odd error. For some reason when exporting a group to multigeometry the KML is missing the opening <MultiGeometry> tag, but it has the closing one. This causes an import error in KML until I manually add the XML tag.

                                            EDIT: terrain_alt([0,0,0]).to_m doesn't seem to return any sensible values. I'm interested if you have an idea about this, too.

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 6 / 7
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement