• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Batch converting skp files to other formats

Scheduled Pinned Locked Moved Plugins
2 Posts 2 Posters 226 Views
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 3 Apr 2013, 18:15

    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 3 Apr 2013, 18:50

      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
      1 / 1
      • First post
        1/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement