Model info -> Geo-location info added via API does not show "This model is manually geo-located"

When modifying geo-location via the API Sketchup.active_model.shadow_info keys, the Model Info → Geo-location panel does not update, and still reports “This model is not geo-located” (1). If I click “Set Manual Location…” (2), the location data is shown, and then only after clicking OK, the message “This model is manually geo-located” (3) is displayed.

(1) Set geo-location data via API, “This model is not geo-located” is still displayed.

(2) Click “Set Manual Location…”, the data is there

(3) Only after manually clicking OK, the message “This model is manually geo-located” is displayed

So the question: Is there a way to effective press the “OK” button via the API?
Otherwise this is not great UX and I would consider it a bug.

Tested on SU2022 Mac, SU2023 Mac. Does it behave the same on Windows?

There is a similar behavior report about C-API SUModelSetGeoReference():

So, I guess it is similar for your case in Ruby API. (?)

There was another recent report here (Feb last) on the Ruby API. I posted some thoughts there.

Either @JeffR or yourself should open an API issue specifically for the Ruby API in the GitHub tracker.

I did not find a fix for this. How do we report it as a bug?

Make sure you’re signed into GitHub, then go to this page:

1 Like

I looked at that attribute dictionary mentioned by @JeffR, and calling

model.set_attribute("GeoReference", "UsesGeoReferencing", true)
DOES seem to cause the message to switch to “This model is manually geo-located”!

Additionally, when the UI is reporting “This model is not manually geo-located”
model.get_attribute("GeoReference", "UsesGeoReferencing") returns false

then clicking “Set manual location…”, and “OK” without modifying the data,
model.get_attribute("GeoReference", "UsesGeoReferencing") now returns true

This was typing at the console, I haven’t tried it in the running extension yet.

That seems rather crazy that the SketchUp UI is displaying the geo-location status based on the value of an attribute like that (and not an internal setting in the file). As noted by others, this attribute dictionary is an undocumented API which is a hangover from the Google days, that may well be fully deprecated at some point, so i wouldn’t really be a robust solution to use that, but maybe it will suffice as a workaround for now.

1 Like

Shadow Info location predates the Geolocation introduced during the Google era. Shadow info dictates how the sun should be positioned and light the scene.

Geolocation includes some additional information, that was stored in attributes as you’ve noted. However, we don’t have an API for this at this point. Please make sure to add your comment to any existing issues in the tracker or log a new one if one is missing for any features you wish to see.

1 Like

So you are on Mac, and Jeff is on Windows. It looks like there is a platform difference.

It may be documented in the Google Earth API, which SketchUp no longer uses itself.

I’m not even sure that Google Earth will use geolocated SKP models anymore. Has anyone tried it with a recent SKP and a recent version of Google Earth ?

I geolocated a model this morning, exported to kmz and opened it with Google Earth (downloaded at that moment) and the model was placed in the right place.

1 Like

Okay … thanks for the confirmation !