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

Ruby coding?

Scheduled Pinned Locked Moved SketchUp Tutorials
sketchup
2 Posts 2 Posters 748 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.
  • P Offline
    Physicsguy1
    last edited by 24 May 2009, 22:42

    i tried to write a code that simply selects the whole model. nothing worked. Can somebody help me? How could i setup a script to delete all components or faces?

    1 Reply Last reply Reply Quote 0
    • C Offline
      Chris Fullmer
      last edited by 25 May 2009, 04:40

      I've written a beginning Ruby tutorial. Since I'm very new to Ruby, its all still very fresh in my mind what I needed to learn to get started writing scripts for SketchUp. So I tried to put all into a simple tutorial. This includes pre-script writing info, like where to find the necessary info, what text editor to use, how to test code inside of SU, and then I write a script and explain what all the code does. This is all in about 10 pages. So its short and very direct (unlike this post). So check it out. See if it helps.

      It shows how to write a code that iterates through all geometry in the model and make an array that holds all the edges, one for the faces, one for the components, and one for groups. So all you would need to do is to take one of those arrays (I'll use the faces array I made in the example below) and do something like:

      entities.erase_entities faces

      Hope that helps. Feel free to post over in the Ruby forum once you get into the coding and have direct questions about it. Hope that helps,

      Chris

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      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