Ruby Sketchup Scriting - Help required! Losing hair!
-
Hello
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...
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"].
Prompts 7 other new drop-down menus. ["Rows", "Variation"].
Based on the parametric variables, the rest of the code designates points to draw, and draws the wire-frame of 20 types of archway.
...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?:
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:
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..)
(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
There needs to be a blind-panic smiley.Deadline is 20 days away.
Thanks,
Andrew -
Note sure about the prompts thing. Maybe I need to read it againt - I just can't get my head to wrap around what you're asking. Sorry.
Invoking TIG's pipe plugins: you want to know how to trigger it?
Cutout components. you need to orient what you draw so the edges that you want to cut the hole is oriented on the XY plane on Z level 0.
-
Hi
I've PM'd you...
You can't effectively call TubbeAongPath directly but you could cannibalize its code...
Making a Gothic window that's scripted is quite a first Ruby -
@tig said:
...Making a Gothic window that's scripted is quite a first Ruby
Wow, I was also just turning my head around this.
If it weren't your first post and you didn't misunderstand me, I'd say this is nuts!
But cool, also (my first, real, major project was in fact some Gothic stuff).Should this not be in the developers' forum, BTW?
And sorry for the offtopic post - take it as welcome
-
That's impressive for a script. As a big fan of Gothic architecture, I wish you luck on completing your project. Wish I could help, but I don't know the first thing about scripting.
-
Thanks for the replies
@thomthom said:
Note sure about the prompts thing. Maybe I need to read it againt - I just can't get my head to wrap around what you're asking. Sorry.
Thats okay - at the moment, all the pop-ups activate. I want the user to be able to select which pop-ups activate using the answers to the first pop-up.
@thomthom said:
Invoking TIG's pipe plugins: you want to know how to trigger it?
I would like to incorporate it within my script (fully credited, of course), so that it selects the wire frame and then triggers.
TIG has agreed to help, so we'll see how it goes
-
any news here?
-
@toto ete said:
any news here?
I helped him out [via PMs] - he met his deadline and is now probably in an alcohol induced coma
-
Advertisement