[Plugin] KML Tools (2.0.0-beta) — updated 31.05.2013
-
This Plugin allows to import and export KML files (Keyhole Markup Language) into Sketchup. SketchUp's current capabilities of KMZ do not go beyond Collada models. These tools fill this wide gap and make it possible to bring almost any feature from Google Earth to SketchUp and back.
Warning: This is not actively developed until I get time to actively develop it. Any type of contributions welcome!
Beta version. Please help testing!
It is intended to be a bridge between Google Earth and SketchUp for people who need it, but it does not want to be a full-fledged KML editor since Google Earth itself has a very capable integrated editor.
Many geo information agencies provide geo-referenced data like building footprints or ground overlays in KML format, and most GPS devices create tracks in KML format that can be used as a basis for modeling. On the other side, it's now also easier to create and edit animated content for Google Earth.Stable version:
Installation: Unzip and place "kmlTools" and "kmlTools.rb" into the SketchUp/Plugins folder. [previous downloads (since 1.4d): 1367]Version: 1.4.12
Date: 25.05.2013
Requirements:
SketchUp 7.0 – SketchUp 2013 (not SketchUp 2014)
Dynamic Components enabledSupported features:
<Model>, <Multigeometry>, <Polygon>, <LineString>, gx:Track, <Point>, <GroundOverlay>, <PhotoOverlay> (only GE→SU), <Camera>, <LookAt>, gx:Tour, <TimeSpan>Usage:
Plugins → KML Tools → Import KML File
If you have a KMZ file (zipped KML), unzip it first. The importer cannot download files, so all ressources must be available locally and network links will be ignored. The result can be more accurate if you first import a big enough Google Earth Terrain via 'File → Geo-Location → Add Location'. Unfortunately KML files larger than ~200 kB can take very long to import.Either select specific groups/components to export or export all:
Plugins → KML Tools → Export KML File
The model must be georeferenced first, it is also beneficial to have a Google Earth Terrain ('File → Geo-Location → Add Location'). For each feature entities should be grouped, but groups should not be nested. A dialog will pop up which shows as which features the entities in the model can be exported. The resulting KML file (and its accompanying folder) can be loaded into Google Earth, tweaked, enhanced and saved as a single KMZ file.
Plugins → KML Tools → Add Timespan to entities
Allows to add/edit timespan attributes. These attributes are used for example by the Google Earth timeslider. This allows to animate building structures over time (historic or future state). Select groups or components and choose a begin and end date (or type the date in this format: yyyy-mm-ddThh:mm). 'Preview' will open a simple time slider to preview the changes.
History:
version 1.4.12: 25.05.2013- small change for comatibility with SketchUp 2013
version 1.4.11: 21.07.2012 - fixed support for pairs of 2 instead of 3 coordinates
version 1.4.10: 01.06.2012 - fixed materials.remove that is only available in SU8M1+
- fixed empty points in polygon import
version 1.4.9: 29.04.2012 - fixed hangup when importing linestrings
version 1.4.8: 09.02.2012 - fixed broken filepath with component export
- fixed orientation of components (reversed tilt angle)
version 1.4.6: 02.02.2012 - fixes for round_to method
version 1.4.5: 28.01.2012 - fixes for elevation import
version 1.4: 10.09.2011 Note: Delete old "kmlTools_loader.rb" - various fixes (hang at styles import)
- support of <StyleMap> added
- registered as SketchupExtension
- registered as importer (now available in 'File' -> 'Import'...)
version 1.3b: 22.07.2011 - various fixes in timeslider and timespan dialog
- fix in kmlImport to remove nil elements from array (line 737 etc.)
version 1.2: 22.06.2011 - time slider added
- dependency on IE8 removed
- typos fixed
version 1.1: 16.06.2011 - groundoverlay: texturewriter doesn't distort images anymore
- wrong date in date picker on Windows fixed
- errors in older SU versions fixed
version 1.0: 15.06.2011
- small change for comatibility with SketchUp 2013
-
Cool work!
-
First I would like to thank you for the plugin, will be very useful!
I try to make it work in SU 7.1 and 8 (both free) but when I try to import a kml it stops on "progress " Fetching elevation data from ...
I click in ... and nothing happens, can you help me? I do not know if the problem may be related to my default browser that is Google Chrome... -
Hello lexmonteiro,
the default browser doesn't matter because SketchUp always uses the operating systems browser (IE/Safari) .That error could mean that the webdialog didn't receive commands from SketchUp. Can you please try it with the new version again? If it doesn't work, can you open the Ruby console while running the plugin and post what you it says?
-
@aerilius said:
Hello lexmonteiro,
the default browser doesn't matter because SketchUp always uses the operating systems browser (IE/Safari) .That error could mean that the webdialog didn't receive commands from SketchUp. Can you please try it with the new version again? If it doesn't work, can you open the Ruby console while running the plugin and post what you it says?
I try it, and got some progress, but it stucks in the next screem:
-
I cannot reproduce the problem. Are you using an older browser than Internet Explorer 8 (it needs version 8)?
If it happens although you have IE8/IE9, maybe you can eventually PM me the kml file? -
Great, thanks Aerilius! I am pretty sure this will be an invaluable tool for many people!
-
Hi
Greetings from Bulgariai receive error on line 840: @model.pages.eachp - no method eachp for Sketchup::Pages.
It works with @model.pages.eachHave a nice day
-
I have the same problem as lexmonteiro (above).
IE 8 Windows 7 64bit. SketchUp 8 Pro. -
@aerilius said:
I cannot reproduce the problem. Are you using an older browser than Internet Explorer 8 (it needs version 8)?
If it happens although you have IE8/IE9, maybe you can eventually PM me the kml file?You're right, I'm using a previous version (IE7).
I've been using Google Chrome for so long that not even remember which version IE I was using ..
I'll update it and then put the results here.
Thank you! -
I had done more than a week testing and hadn't imagined that there still could be such issues.
Now I've uploaded a new version. I found a work-around to drop the IE8 requirement and fixed some more things. I hope it works this time. -
It works fine now, ie7 and SU 7.1 free!
Thank you!
-
Thanks very much
-
Hi there Aerilius.
You say
@unknownuser said:it's now also easier to create and edit animated content for Google Earth
and I see there is a timespan option on the menu. Can you explain what this does and an example of how to use it?
Thanks
-
is this working with SU version 8 on mac or is there another solution in the meantime? what i'm missing in SU 8 is the ability to batch capture a sequence of aligned terrains. the frame tool in SU8 is making a manual selection of an area around an already captured terrain very difficult. anyone?
cheers
markus
-
Might be a silly question, but here it goes.
Is it possible to completely remove the entire process of downloading elevation data? I do not need it, as I am using the drape tool with the files, and can manually georeference the KML files.
I've tried deleting that portion of the code, but I know nothing about Ruby, so I really don't know what I'm doing.
Thanks.
This tool is exactly what I needed by the way, thanks for the development!
-
I think it should assume an elevation of 0 if it can't connect to the internet. So you could disconnect from the internet and after using the tool you can reconnect again. Tell me if that solves it
-
Looks like that part of the script is working now (I re-downloaded the files, maybe they were/are corrupted for me).
I am getting the following error now, though:
no JSON returned (which I'm expecting)
Error: #<NoMethodError: undefined method[]' for nil:NilClass> ...kmlTools/kmlImport.rb:737:in
points_to_plane'
...kmlTools/kmlImport.rb:737:ineach' ...kmlTools/kmlImport.rb:737:in
points_to_plane'
...kmlTools/kmlImport.rb:320:inpolygon' ...kmlTools/kmlImport.rb:205:in
run2'
...kmlTools/kmlImport.rb:205:ineachp' ...kmlTools/kmlImport.rb:632:in
each_with_index'
...kmlTools/kmlImport.rb:632:ineach' ...kmlTools/kmlImport.rb:632:in
each_with_index'
...kmlTools/kmlImport.rb:632:ineach' ...kmlTools/kmlImport.rb:205:in
run2'
...kmlTools/kmlImport.rb:176:ineach' ...kmlTools/kmlImport.rb:176:in
run2'
...kmlTools/kmlImport.rb:114:infetch_alt' ...kmlTools/kmlImport.rb:109:in
call'Thanks again.
Mark
-
@marktonium said:
I am getting the following error now, though:
Hi Mark,
I have fixed something that could have caused this error in line 737. After reading the kml file, the plugin could have come across some unexpected (empty) elements. Can you check if it works now? -
@3dworks said:
is this working with SU version 8 on mac or is there another solution in the meantime?
Hi 3dworks,
It is not yet tested on mac, but it shouldn't contain anything specific that doesn't work on both platforms.@3dworks said:
[...] the ability to batch capture a sequence of aligned terrains.
That's probably not in the scope of this plugin, but it's a question that many people ask. Technically it is not possible to do the batch part automatically (because one had to interfere with the Add location tool in a way that is impossible), but one could imagine a tool that helps to perfectly align the selection rectangle to the previous terrain.
Advertisement