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

    Custom importer - setting options

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 3 Posters 489 Views 3 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.
    • tt_suT Offline
      tt_su
      last edited by

      You made an importer from scratch? In which case I don't see why the SU settings should affect your code. I'd be hard to say what is going on without seeing your code though.

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        Oh... hang on. Is your importer calling The Ruby API Model.import method?

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

          @tt_su said:

          Oh... hang on. Is your importer calling The Ruby API Model.import method?

          Yes it its. I'm making an ugly workaround for the missing <orientation> info. Basically using the built-in importer but also unzipping the KMZ and reading the KML file myself and making the necessary adjustments (tilt, rotation, heading) to the geometry in the model (according to angles from KML) before using the built-in exporter. Some other changes are also made but they are unrelated.

          Before this i've tried for days to fetch those angles somewhere in Sketchup but i finally came to the conclusion that the importer is broken - correct me if i'm wrong.

          Thanks for the quick reply! πŸ˜„

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            I don't know much about the importers themselves. I have to ask someone else on the team - they are not online yet as they are all in the US.

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

              Ok thanks. Please post here when/if you get more information. It would be great if both problems could be solved somehow.

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                The Sketchup::Importer#do_options() example is totally wrong. (It is the terse, almost worthless, example for id().)

                The API should explain how options are used and stored.

                I'm not here much anymore.

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

                  @tt_su said:

                  I don't know much about the importers themselves. I have to ask someone else on the team - they are not online yet as they are all in the US.

                  Any news on this?

                  1 Reply Last reply Reply Quote 0
                  • tt_suT Offline
                    tt_su
                    last edited by

                    Sorry about the delay in response. The API is currently missing the ability to set import options. I ensured we had a feature request for it filed.

                    But it appear that what you do is a workaround for an issue with the existing importer. Would you mind describing the issue in detail and provide samples that illustrate?

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

                      @tt_su said:

                      But it appear that what you do is a workaround for an issue with the existing importer. Would you mind describing the issue in detail and provide samples that illustrate?

                      This shows a couple of problems i have ran into:

                      Start Sketchup
                      Make a cube
                      Geolocate model
                      Save as SKP
                      Export as "test_model.kmz"

                      • in KML now <Orientation><heading>-0</heading><tilt>0</tilt><roll>0</roll></Orientation>
                        Try kmz in Google Earth - OK
                        Close Sketchup
                        Start Sketchup
                        Import test_model.kmz
                        Modelinfo -> Geo-location "This model is not GeoLocated" it says
                        Check dictionaries (my own script - screenshot on this)
                      • Model has two(!) georeference dictionaries
                        Export to KMZ again "test_model_imp_kmz+exp_kmz.kmz"
                        Test in Google Earth even tho SU says "not geolocated" - OK (ends up in exact same spot as the first one)
                        Delete all but last GeoReference dictionaries in SU with own script
                        Check dictionaries
                      • Only one GeoReference entry exist now (see screenshot)
                        Modelinfo -> Geo-location "This model is accurately geolocated"
                        === END OF A PROBLEM WITH DUPLICATE GEOREFERENCE DICTIONARIES MAKING SU SAY "MODEL NOT GEOLOCATED" EVEN IF IT IS ===
                        Close Sketchup
                        Unzip "test_model.kmz"
                        Change under <Model> .... <Orientation> to random values
                      • <Orientation><heading>33</heading><tilt>-70</tilt><roll>-20</roll></Orientation>
                        Zip (with changes) and rename to "test_model_MOD.kmz"
                        Test in Google Earth "test_model_MOD.kmz" (should be "flying" now - OK)
                        Start Sketchup
                        Import "test_model_MOD.kmz"
                        Export to "test_model_MOD_imp_kmz_exp_kmz.kmz"
                        Test in Google Earth "test_model_MOD_imp_kmz_exp_kmz.kmz" (should be flying but it is NOT)
                        Look in the KML in "test_model_MOD_imp_kmz_exp_kmz.kmz"
                      • <Orientation><heading>-0</heading><tilt>0</tilt><roll>0</roll>
                        !! THE CHANGES ARE LOST !!

                      So this is basically why i need to parse the KML. I get models where roll/tilt/heading is set and when changes are made inside Sketchup and then exported to KMZ again, model ends up in wrong place in Google Earth. Well, its not in wrong place, its just rolled/tilted/rotated wrong actually but it looks like it is in the wrong place.

                      I will attach the files too.


                      Created and geolocated inside Sketchup then exported


                      Imported then exported


                      test_model.kmz modified heading roll tilt under the <Model> tag in KML


                      Modified imported then exported


                      Duplicate GeoRef dictionaries


                      After remove of duplicate GeoRef dictionaries

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

                        @tt_su said:

                        Sorry about the delay in response. The API is currently missing the ability to set import options. I ensured we had a feature request for it filed.

                        I forgot to say thankyou for this. Hope it gets sorted out. πŸ˜„

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement