How to retrieve the version of the model
-
is there a way using ruby?
i found the code to retrieve the version of sketchupsketchup_v = Sketchup.version_number.to_s
but i don't see anything to do the same for the model itself
-
You need to read in the first part of the binary file SKP and see what version it says...
SketchUp Model{17.0.18899}䖯挢べ仪躯蘚䆤寸ÿ...In Ruby try something like this:
vv=File.open(skp_path, 'rb'){|f| f.read }.unpack('m*').pack('m').gsub(/SketchUpModel/,'').to_i.to_s;if vv[0].chr=='1';v=vv[0].chr+vv[1].chr;else;v=vv[0].chr;endskp_pathis the full path to the SKP you are trying to find the version of.
vvis the long version number, as a string [e.g."17018899"]
vis the short version number, as a string [e.g."17"]
If you want more details parsevvdifferently...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement