Hello ![:smile: π](https://community.sketchucation.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=3orp1bvic7q)
I have been registered here for a while, and this is my first post.
A short background: - I'm in my 6th and final year studying Architecture at Newcastle University, and am doing an 'Emergent Digital Design Methods' module which results in the hand-in of a scripted working prototype of an architectural model, either in ArchiCAD, 3D Studio Max, or whatever else. Two-thirds of us have chosen Ruby & SketchUp, since SketchUp is so very widespread.
I know what I want my script to achieve, and have examples of scripts that achieve it in small parts. Cannibalised and combined, I should be on my way. But translating parts of scripts to work within my own has exposed my massive lack of knowledge of programming (we haven't been specifically taught it) and time is beginning to run short.
I'm fumbling around with trail and error (mostly error) in Notepad++ & Sketchup, with reference to the Sketchup Ruby API and using the Ruby Console.
I'd hope to be able to compensate excessively useful information or tutorials that prove to work..!
So... ![:flushed: π³](https://community.sketchucation.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f633.png?v=3orp1bvic7q)
I have a block of code which intends to create variations of gothic arch. All it does so far is to:
Prompt a UI popup asking the user to enter 3 parametric variables ["Base Height", "Base Width", "Arch Height"] and select 2 drop-down menu variations ["Type", "Glazing"].
![http://i77.photobucket.com/albums/j78/Levethian/6.jpg?t=1261419676](http://i77.photobucket.com/albums/j78/Levethian/6.jpg?t=1261419676)
![http://i77.photobucket.com/albums/j78/Levethian/7.jpg?t=1261419678](http://i77.photobucket.com/albums/j78/Levethian/7.jpg?t=1261419678)
Prompts 7 other new drop-down menus. ["Rows", "Variation"].
![http://i77.photobucket.com/albums/j78/Levethian/3.jpg?t=1261419061](http://i77.photobucket.com/albums/j78/Levethian/3.jpg?t=1261419061)
![http://i77.photobucket.com/albums/j78/Levethian/8.jpg?t=1261419678](http://i77.photobucket.com/albums/j78/Levethian/8.jpg?t=1261419678)
Based on the parametric variables, the rest of the code designates points to draw, and draws the wire-frame of 20 types of archway.
![http://i77.photobucket.com/albums/j78/Levethian/4.jpg?t=1261419137](http://i77.photobucket.com/albums/j78/Levethian/4.jpg?t=1261419137)
![http://i77.photobucket.com/albums/j78/Levethian/9.jpg?t=1261419679](http://i77.photobucket.com/albums/j78/Levethian/9.jpg?t=1261419679)
...And that is all. The parametric parameters and equations for the points function as expected.
My problems start as follows:
I don't want the 7 pop-up menus to prompt, and I don't want all the arch type wire-frames to load at once. 2 menus max should prompt depending on the user-selection of 'types'. How do I link the values of "types" [0, 1, 2, 3] to blocks of code to load? Do I need to implement a data system?:
![http://i77.photobucket.com/albums/j78/Levethian/2.jpg?t=1261419059](http://i77.photobucket.com/albums/j78/Levethian/2.jpg?t=1261419059)
Or can either of these problems be addressed by 'If True Then Else' commands?
My second problem is that I'd like to incorporate 'TubeAlongPath' by TIG (c) 7/2005 to automatically select the wire-frame, so that once the frame is loaded, TIG's prompt for the TubeAlongPath starts. The result should be something like:
![http://i77.photobucket.com/albums/j78/Levethian/10.jpg?t=1261419680](http://i77.photobucket.com/albums/j78/Levethian/10.jpg?t=1261419680)
My final problem will be to include functionality which allows the groups to be instantiated as a component which snaps to planes and cuts into surfaces. (I think this would involve the overhaul of the point-arrays to include 'origin' instead of (0, 0, 0), and then tell the origin to be user-defined..)
![http://i77.photobucket.com/albums/j78/Levethian/11.jpg?t=1261420435](http://i77.photobucket.com/albums/j78/Levethian/11.jpg?t=1261420435)
(from reference script)
I'd be really grateful for any help, and would be pleased to make up for useful contributions (since I have a Thesis to worry about as well!). My many days of experimentation have yielded very few eureka-moments, unfortunately ![:disappointed: π](https://community.sketchucation.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=3orp1bvic7q)
There needs to be a blind-panic smiley.
Deadline is 20 days away.
Thanks,
Andrew