• Login
sketchucation logo sketchucation
  • Login
🤑 30% Off | Artisan 2 on sale until April 30th Buy Now

Roof.rb v1

Scheduled Pinned Locked Moved Plugins
80 Posts 20 Posters 10.0k 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.
  • T Offline
    TIG Moderator
    last edited by 8 Dec 2007, 04:21

    @marne said:

    works perfect for me. thank you, great script.

    i use xp sp 2 and SU 6.0.515 and it works, it must be anything else...

    Thanks for some positive feedback.

    Perhaps it's a script clash - this might show in the Console messages ?
    The script is packed but its classes include:
    class Geom::Vector3d >>> to_flat_angle
    class Geom::Point3d >>> is_on_face?
    class Sketchup::Face >>> offset_eaves(dist)
    and then...
    Roof itself has a class 'Roof' with methods:
    Roof::hip()
    Roof::mansard()
    Roof::gable()
    Roof::pyramid()
    Roof::get_slope()
    Roof::help()

    • plus for data manipulation...
      Roof::ordered_edge_points(face)

    Anyone know of clashing class/methods in other scripts etc ?

    TIG

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 8 Dec 2007, 04:23

      Eric, you had trouble with the .mht file showing images.

      Does you Internet Options > Advanced window look like this ?
      It should.

      http://www.sketchucation.com/forums/scf/sas/Ruby/IOsettings.jpg

      TIG

      1 Reply Last reply Reply Quote 0
      • R Offline
        rhankc
        last edited by 8 Dec 2007, 04:24

        I am happy to report, initial test produced a roof, a gable roof over a rectangle. I toggled all the menu settings, included the carat, used degrees rather than rise/run, inches rather than ft in,
        made a rectangle 30 degree pitch gable

        attempt to make another gable, I get the attached jpg.

        Then I work with the hip settings:
        this is the ruby console error when making hip w/ ^45 pitch
        BulkChange: 1
        1
        BulkChange: 2
        2
        Error: #<NoMethodError: undefined method to_f' for ["^45"]:Array> (eval):163:in dialog_hip'
        (eval):189:in hip' (eval):2720 (eval):2720:in call'

        using 45 w/out the carat doesnt change anything

        The most prevelant message is th jpg, it isnt allowing any repeat roofs

        Nvidia GE Force 7300 LE
        XP SP2
        SU vers 6.0.515

        anything else I can test, let me know

        Hank

        1 Reply Last reply Reply Quote 0
        • R Offline
          rhankc
          last edited by 8 Dec 2007, 04:26

          I am getting better with it!
          I am getting repeat roofs in the smae file. When it quits I close itt down and start another and do it till it gets the jpg. posted earlier
          if I enter for pitch; ^45, it seems to me I would get a 12:12 pitch, but I get 12.4 degrees
          enter ^68 I get a roof at 20.9 degrees.

          In the help guide It says enter decimals or on the menu enter inches and when inches are entered on the menu, it shows as feet. example enter 24", it shows as 2'

          Hank

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 8 Dec 2007, 04:26

            rhankc

            I think you are misunderstanding how to enter the roof 'slopes'. It is done differently for hip/mansard and gable/pyramid roofs.

            For a hip or mansard/sprocket roof you can only enter the roof slope as an angle in degrees [a number] e.g. 22.5, OR the slope as a ratio [separated by ':'] e.g. 2:5. For these types you CAN'T enter a ridge/apex height using a ^. If you do it should return an error thinking you've entered zero degrees

            For a gable or pyramid roof you can enter the angle or ratio as above OR additionally you can specify the ridge/apex height above the fascia in current units by prefixing it with a ^, e.g. ^1234 (here assuming mm this puts the ridge/apex at 1234mm high). Don't use a units suffix or try '/" - so 1234.5 (in mm) is OK as is 18 (in inches) or 1.5 (in feet) but NOT 1'6".

            When you make a hip or mansard you need to have one horizontal face selected otherwise you'll get error messages.

            When you make a gable you need to select one face that's both horizontal and forms a rectangle, AND also select an edge that's near where you want the 1st gable to be (that's needed to tell the tool which of the rectangle's sides are to form gables and which of them is the 1st one, since you can apply different settings to the 1st and 2nd gables).

            When you make a pyramid you need to select one face that's both horizontal and forms a rectangle, AND also select an edge that's on a side where you want the angle for the slope to be taken from - with a non-square pyramid the two pairs of opposing faces have different slopes so you need to do this to indicate which gets the degrees/ratio you've given. Note that you need to select one of this rectangle's edges even if you intend later to use ^1234 as the height of the apex instead of entering degrees or a ratio, as at the point where you set off the tool has no way of knowing what options you might choose later...

            Your item about it saying inches in the menu prompts and it showing it in feet is a function of SketchUp: if you are working in Architectural units - inches - and you enter 18" it's taken OK but when you reopen the dialog it will show 1' 6" - the prompt simply tells you that your current units are set to inches [or feet or cm or whatever] - SketchUp displays Architectural inches as feet+inches if it's >12".

            TIG

            1 Reply Last reply Reply Quote 0
            • B Offline
              boofredlay
              last edited by 8 Dec 2007, 04:27

              @tig said:

              Does you Internet Options > Advanced window look like this ?
              It should.

              Here is mine at home, I won't be able to check work until Monday.

              http://www.sketchucation.com/forums/scf/sas/Ruby/Internet-Properties.jpg

              http://www.coroflot.com/boofredlay

              1 Reply Last reply Reply Quote 0
              • R Offline
                rhankc
                last edited by 8 Dec 2007, 04:28

                Thanks for the detailed explanation.
                I get pyramid roof no problem. I havent tried a mansard, but I will.

                The only way I can get gable to respond is using a ^ before a specified height. The other techniques dont produce anything. I was seeing the difference in what was entered for eaves etc. and thought it was a SU thing so I had changed my units to decimal-inches and was still getting the ft-in after entering a value in inches. That is why I mentioned it. it is now entering as expected.

                After a few roof sessions, (keep making different roof modules) I get the image I posted earlier even though I have the edge and horizontal surface selected. It wont get over the message until I start a new file.

                This is going to be a great tool. thanks

                Hank

                1 Reply Last reply Reply Quote 0
                • T Offline
                  TIG Moderator
                  last edited by 8 Dec 2007, 04:28

                  @rhankc said:

                  The only way I can get gable to respond is using a ^ before a specified height. The other techniques dont produce anything...
                  After a few roof sessions, (keep making different roof modules) I get the image I posted earlier even though I have the edge and horizontal surface selected. It wont get over the message until I start a new file.

                  IF you open a new model, open the Ruby Console and then make a rectangle + push'pulled to a volume, then run Roof...Gable and accept all of the defaults that appear in the dialog what happens ?

                  With your 'non-rectangle' error... it's as if multiple editing make what is a rectangle slightly skewed. Maybe I need to build in some 'tolerance' as to what makes a 'rectangle'...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    rhankc
                    last edited by 8 Dec 2007, 04:29

                    that is the perfect question...
                    the first run after the initial boot, I built a rectangular cube, and ran the roof tool on gable after selecting one edge and the top plane. I saw nothing happen.

                    I did it again exactly as you described for a gable: nothing happened.

                    To get a roof model the first attempt, this is what I tried: I went thru the menu and toggled each setting, basically rekeyed everything there and entered 12:12 for a pitch. I got nothing; then I noticed the ^ wasn't included in the pitch indicator, so I set ^12 , and got a low pitch roof.

                    here is the ruby console script:
                    Added: 1 :: #Sketchup::Face:0x4e3ad38
                    Cleared: #Sketchup::Selection:0x4e58480
                    Added: 1 :: #Sketchup::Face:0x4e3a0c0
                    Cleared: #Sketchup::Selection:0x4e58480
                    Added: 1 :: #Sketchup::Face:0x4e3a0c0
                    Cleared: #Sketchup::Selection:0x4e58480
                    BulkChange: 1
                    1
                    BulkChange: 2
                    2
                    Error: #<NoMethodError: undefined method to_f' for ["1", "2"]:Array> (eval):1385:in dialog_gable'
                    (eval):1494:in gable' (eval):2722 (eval):2722:in call'

                    Hank

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      humanticnc
                      last edited by 8 Dec 2007, 04:30

                      hi halli

                      http://www.sketchucation.com/forums/scf/sas/Ruby/roof-1.png

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        dylan
                        last edited by 8 Dec 2007, 04:31

                        Just tried this on Vista also with SU Pro latest version and still does not work.

                        http://dmdarchitecture.co.uk/

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          rhankc
                          last edited by 8 Dec 2007, 04:31

                          Dylan,
                          There is definatly some technique to it, but when there is a roof drawn it is a pretty thing! I think there is alot of computing power going into this thing. Try a gable, Use the ^ (carat) or whatever it is,enter a # rekey all the menu settings, should give a roof.

                          Hank

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            TIG Moderator
                            last edited by 8 Dec 2007, 04:32

                            @unknownuser said:

                            Just tried this on Vista also with SU Pro latest version and still does not work.

                            This is a real mystery... but it shall be solved.

                            If you open a new model, open the Ruby Console, make a rectangle, pushpull it into a box, select the top face and an edge belonging to that face (with Shift or Ctrl) and run the tool Roof...Gable..., then accept all of the dialog's defaults with an OK what happens ? Any error or console messages, is there a group made where the roof might be, etc.

                            I appreciate that its not working is frustrating for you, BUT it's doubly frustrating for me when it seems to works in identical set-ups elsewhere without any hitch, and you're not giving me many clues as to what's wrong - except that, "it's not working..."

                            I appreciate your feedback, but please can it be a bit more detailed...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • R Offline
                              rhankc
                              last edited by 8 Dec 2007, 04:34

                              wish I had three monitors for this:
                              New untitled.There is a template here
                              Here is the first step:Ruby console on:Rectangle push/pull into cube:
                              console text:
                              Added: 1 :: #Sketchup::Face:0x4415260
                              Cleared: #Sketchup::Selection:0x4438480
                              Added: 1 :: #Sketchup::Face:0x44148e8
                              Cleared: #Sketchup::Selection:0x4438480
                              Select edge and plane:
                              BulkChange: 1
                              1
                              BulkChange: 2
                              2
                              Plugins>Roof>got the message I attached earlier. Going to start over.

                              new untitled, and all the way to the flyout at gable selection was the same except this time I got the Gable roof setting menu.
                              Accept all defaults>OK
                              The box plane & line is still hi-lited and absolutely nothing happened, no flash or resemblence of a roof.
                              Here is the last sequence of commands ruby console text:
                              Error: #<NoMethodError: undefined method to_f' for ["1", "2"]:Array> (eval):1385:in dialog_gable'
                              (eval):1494:in gable' (eval):2722 (eval):2722:in call'

                              I am going to load another start template, if it works any better I'll let you know.

                              Hank

                              1 Reply Last reply Reply Quote 0
                              • R Offline
                                rhankc
                                last edited by 8 Dec 2007, 04:35

                                Ok, I fired up my laptop which has XP 2002 SP2 and a ATI Mobility Radeon X600 G.C. that has a version of 5 & 6 on it but no rubies to speak of:examples.rb,RPS_Ray Trace.Rb, Utilities.rb,parametric.rb,oniondome.rb,bezier.rb,grid.rb,windows.rb,shapes.rb, rectangle .rb, and the roof.rb

                                There are very few inhibitors here, and I could possibly uninstall all but the defaults if you think they may be in the way.

                                I had the same response as the previous attempt, which is no group, stuff still highlited etc. on both versions.

                                Hank

                                1 Reply Last reply Reply Quote 0
                                • S Offline
                                  seasdes
                                  last edited by 8 Dec 2007, 04:42

                                  Thanks TIG. A truly remarkable script. You have put a lot of thought into this script as always.It also works fine in SU6 and XP Pro.

                                  Seasdes

                                  Using Sketchup Pro 2019

                                  1 Reply Last reply Reply Quote 0
                                  • A Offline
                                    alpro
                                    last edited by 8 Dec 2007, 04:43

                                    TIG, this is a great looking script, unfornuately it also isn't working for me, I select a face, get the first dialog box, hit ok and get nothing, no errors, no roof, no second dialog box. I'm running Vista and SU Pro 6.0.515, hope you can get it figured out because like I said, it looks like a great script.

                                    Mike

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      alpro
                                      last edited by 8 Dec 2007, 04:45

                                      TIG, here's a screen shot of my ruby console.

                                      Mike

                                      http://www.sketchucation.com/forums/scf/sas/Ruby/errors.jpg

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        dylan
                                        last edited by 8 Dec 2007, 04:56

                                        Hi TIG,

                                        I have tried the script as you asked and have posted the results.
                                        I tried Gable Ended Roof and Hipped Roof.

                                        Gable ended I picked the top face and one edge and got the attached error (image 1 & 2).

                                        Hipped roof I get the following info in the ruby box (image 3)

                                        Running on XP SP2, SU Pro 6.0.515

                                        Thanks

                                        http://www.sketchucation.com/forums/scf/sas/Ruby/3.jpg

                                        http://www.sketchucation.com/forums/scf/sas/Ruby/2.jpg

                                        http://www.sketchucation.com/forums/scf/sas/Ruby/1.jpg

                                        http://dmdarchitecture.co.uk/

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          TIG Moderator
                                          last edited by 8 Dec 2007, 04:58

                                          @alpro said:

                                          TIG, here's a screen shot of my ruby console.
                                          Mike

                                          I've posted v1.1 that fixes your problem = http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=1516
                                          Replace the current version with this one.

                                          At least that error report is fixed. Now for some other errors...

                                          TIG

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

                                          Advertisement