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

    Batch converting skp files to other formats

    Scheduled Pinned Locked Moved Plugins
    2 Posts 2 Posters 226 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.
    • A Offline
      Arzka007
      last edited by

      I'm trying to make a small Ruby script that batch converts .skp files to other formats...

      Could someone show sample code on how to open .skp file and then export it as .dae? I tried this but for some reason it's not working (.dae file has different content than original .skp file):

      model = Sketchup.active_model
      model.import "C;/skp_files/example.skp"
      model.export "C;/dae_files/example.dae"
      
      1 Reply Last reply Reply Quote 0
      • A Offline
        Aerilius
        last edited by

        It seems importing an skp file as a component requires user interaction, namely to place it somewhere (Trimble?!?!).

        Try this:

        
        model = Sketchup.active_model
        file = "C;/skp_files/example.skp"
        Sketchup.open_file(file)
        model.export(file.sub(/\.skp$/, ".dae"))
        
        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