• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Random Name Chooser

Scheduled Pinned Locked Moved Developers' Forum
1 Posts 1 Posters 371 Views 1 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.
  • F Offline
    fizgig
    last edited by 4 Dec 2009, 16:47

    I was at a tradeshow a couple of days ago where we used a scanner to scan people's names in for a drawing later that day. It had an SD card in it and I wondered if the file would be a simple text file with csv delimitting and it turned out it was. I then wondered if I could use sketchup to program a random name drawing system based off that text file. A few minutes of programming later, there it was.

    It flashes name after naming while slowing down just like a spinning wheel using exponentially growing delays and beeps to build the suspense.

    I couldn't find a command to select all and delete all so I have lame loop that keeps deleting top level entities until there aren't any so the next name can be displayed:

    Sketchup.active_model.entities.each {|yo| yo.erase!} while Sketchup.active_model.entities.length != 0
    

    Anyhow, it's attached if anyone can use it. I'm sure it can be optimized quite a bit. Wonder if sketchup's ever been used like this before...


    random.rb

    1 Reply Last reply Reply Quote 0
    • 1 / 1
    1 / 1
    • First post
      1/1
      Last post
    Buy SketchPlus
    Buy SUbD
    Buy WrapR
    Buy eBook
    Buy Modelur
    Buy Vertex Tools
    Buy SketchCuisine
    Buy FormFonts

    Advertisement