Author/credits API ?
-
anyone found the API for author/credits (Model Info Credits tab) get/set ?
-
ad=model.attribute_dictionaries['GSU_ContributorsInfo'] ad.each_pair { |k,v| puts "#{k} - #{v}" }
No claimed credit:
LastModifiedByKey - VersionKey - 1000
Claimed credit:
NicknamesKey - ThomThom UserIdsKey - 1596327803470505363806298 VersionKey - 1000
-
thanks Thomas.
model.set_attribute("GSU_ContributorsInfo", "NicknamesKey", "TBD") Error; #<RuntimeError; (eval);0;in `set_attribute'; Not allowed to create Contributors attribute.>
so no set functions ?
-
They protected the attribute?? -
Are they saved as attributes ?
The bold ones are relevant ?Sketchup.active_model.attribute_dictionaries.each{|dict|dict.each_pair{|k,v|puts dict.name+" = "+k+", "+v.to_s}}
GeoReference = GeoReferenceNorthAngle, 359.856819594067
GeoReference = Latitude, 49.2179779934131
GeoReference = LocationSource, Google Earth
GeoReference = Longitude, -122.810932099834
GeoReference = ModelTranslationX, -20227104.4083539
GeoReference = ModelTranslationY, -214634055.964147
GeoReference = ModelTranslationZ, -39.3700760693234
GeoReference = TimeStamp, 1277506001
GeoReference = UsesGeoReferencing, true
GeoReference = ZValueCentered, -39.3700760693234
GSU_ContributorsInfo = LastModifiedByKey,
GSU_ContributorsInfo = NicknamesKey, SnowTiger
GSU_ContributorsInfo = UserIdsKey, 1379538105755232331646158
GSU_ContributorsInfo = VersionKey, 1000
temp = temp, 0
TempShadowInfo = City, N/A
TempShadowInfo = Country, N/A
TempShadowInfo = Dark, 20
TempShadowInfo = DaylightSavings, false
TempShadowInfo = DisplayNorth, false
TempShadowInfo = DisplayOnAllFaces, true
TempShadowInfo = DisplayOnGroundPlane, true
TempShadowInfo = DisplayShadows, false
TempShadowInfo = EdgesCastShadows, false
TempShadowInfo = Latitude, 49.2179779934131
TempShadowInfo = Light, 80
TempShadowInfo = Longitude, -122.810932099834
TempShadowInfo = NorthAngle, 359.856819594067
TempShadowInfo = TZOffset, -9.0
TempShadowInfo = UseSunForAllShading, false
3DWarehouse = ModelID, 51672e6c82c9025a6ec596733cc71eed
2Dtools = z, 0" -
-
Dan: batch editing lots of files
-
Yes but it's not something I wish to post publically. (It involves the Google account login, and a person's proprietary claim on their work?)
EDIT: .. well gee you guys just publish your IDs why dont ya?
Why would you want to change these settings?
-
@unknownuser said:
Dan: batch editing lots of files
Hmmm... if it is not yet set.. you should be able to set it. Enter a feature request?
-
<span class="syntaxdefault">attdicts</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">delete</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'GSU_ContributorsInfo'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxcomment">#<Sketchup;;AttributeDictionaries;0x5f39760><br /></span><span class="syntaxdefault">attdicts</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">count<br />0</span>
-
yeah. that removes the credits. but the idea is to add them (still the same error as when trying to modify them)
so it is not possible in current version to add credits programmatically
-
I was thinking maybe you could create a dictionary with a temp name, delete the old one, then rename the new one, but ... I don't see a rename() or name= method for dictionaries.
-
There is no 'name=' option for dictionaries - you have to clone the whole thing with a new name and delete the original.
The core-code magically prevents the specific dictionary name [GSU_ContributorsInfo] from being 'made' or edited by the standard users [although we have seen that 'deleting' it is possible - but I'd think that's probably an oversight by Google] - BUT of course it IS editable somehow... because Google can do it !
Advertisement