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

    How to retrieve the version of the model

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 810 Views 2 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.
    • G Offline
      glro
      last edited by

      is there a way using ruby?
      i found the code to retrieve the version of sketchup

      sketchup_v = Sketchup.version_number.to_s

      but i don't see anything to do the same for the model itself

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        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;end
        

        skp_path is the full path to the SKP you are trying to find the version of.
        vv is the long version number, as a string [e.g. "17018899"]
        v is the short version number, as a string [e.g. "17"]
        If you want more details parse vv differently...

        TIG

        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