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

    Ruby coding?

    Scheduled Pinned Locked Moved SketchUp Tutorials
    sketchup
    2 Posts 2 Posters 748 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.
    • P Offline
      Physicsguy1
      last edited by

      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
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

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

        Advertisement