sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    SKP 2017 - saving component to file via ruby

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 1.8k 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.
    • artmusicstudioA Offline
      artmusicstudio
      last edited by

      hi,
      is there any hidden parameter in the api (now in skp 2017), that would alow me to save a compo-definition to a file (name.skp) in version 2015 instead of the version of the opened skp-session?
      the reason is, that i have a version of a vis-program, which does not import version 2017-files.
      (at the moment i have to re-open them in a new skp-session and save_as....)

      or is there a converter, which could be launched from ruby-api to batch-convert the saved compos in a selected folder?

      than in advance.

      stan

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

        Look at
        https://sketchucation.com/pluginstore?pln=TIG_save_all_components
        which saves all components out as the current SUp version.

        You then need to process the folder of SKP's and change the SUp version.
        Try the attached RB - put it in your Plugins folder
        [open that using this in the Ruby Console
        UI.openURL("file:///#{Sketchup.find_support_file('Plugins')}")
        ]
        Usage:
        Open a new empty SKP.
        Run the tool from its File menu item:
        "TIG-batchSKPversion"
        In the dialog that appears navigate to the required folder of SKP files to be processed and pick any one SKP file.
        Press OK.
        ALL SKP files in that folder will be processed as new version SKP files in turn.
        The new SKP files share the SKP files names, and go into a '2015' subfolder.
        If the Ruby Console is open the SKP names are shown in turn.
        Change version = in the RB file if saving to another version as desired...


        batchSKPversion.rb

        TIG

        1 Reply Last reply Reply Quote 0
        • artmusicstudioA Offline
          artmusicstudio
          last edited by

          hi tig,
          thanx for replying,
          i just red your code and suppose, that every skp-file, you call, will be opened in the viewport and resaved as another version - correct? so it cannot be used as a background task within (under) a running sketchup session (maybe a parallel skp-session opens..... πŸ˜„),
          have to try it out later this evening.
          what is a big help for me, is the declaration <<ver=Sketchup::Model::VERSION_2016>>,
          i must have missed it in the api-doc.
          the rest is clear.

          but: so there is no way to declare the skp-version when saving a compo to a file, i guess...
          thanx
          stan

          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