sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    [Plugin] Polar line - 20110525

    Scheduled Pinned Locked Moved Plugins
    63 Posts 21 Posters 33.4k Views 21 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.
    • M Offline
      Matt666
      last edited by

      Hum... Another Pac problem!! Damned. I don't know what's the problem, and I've no mac... Can you copy here the error in the ruby console please ?
      Thank you...
      Matt.

      Frenglish at its best !
      My scripts

      1 Reply Last reply Reply Quote 0
      • EdsonE Offline
        Edson
        last edited by

        here you have it.


        Picture 6.png

        edson mahfuz, architect| porto alegre β€’ brasil
        http://www.mahfuz.arq.br

        1 Reply Last reply Reply Quote 0
        • M Offline
          Matt666
          last edited by

          I don't understand the problem... Again !! Grmbl.
          Can you try line below in the ruby console, please ?

          Math.cos(45.degrees)
          

          And these lines

          a = Geom;;Point3d.new(12.5,12.5,25.2)
          a[0]
          a[1]
          a[2]
          

          On each line, can you give me the results, please ?
          Thank you again for your patience, Edson!

          Frenglish at its best !
          My scripts

          1 Reply Last reply Reply Quote 0
          • EdsonE Offline
            Edson
            last edited by

            is this what you wanted?


            Picture 7.png

            edson mahfuz, architect| porto alegre β€’ brasil
            http://www.mahfuz.arq.br

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Edson: you wrote 0 = Geom:: and 1 = Geom:: . That's not what he wanted. Just type exactly what he listed.

              First:

              a = Geom;;Point3d.new(12.5,12.5,25.2)
              

              Then

              a[0]
              

              and so on.

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • EdsonE Offline
                Edson
                last edited by

                is this it?


                Picture 8.png

                edson mahfuz, architect| porto alegre β€’ brasil
                http://www.mahfuz.arq.br

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  Yes, like that. πŸ˜„

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    Matt666
                    last edited by

                    Thank you Edson and Thomthom !
                    I really really don't understand...

                    Can someone help me for this bug, please ?

                    Frenglish at its best !
                    My scripts

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      I can have a look on my own Mac when I get home.
                      Looks very weird. Does PC SU and MacSU use the same Ruby version?

                      Have you tried placing () around lg * Math.cos(ang) . (just a wild guess)

                      Thomas Thomassen β€” SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        Hey, I notice you use $lg and then lg. Is it suppose to be two different things?

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          Matt666
                          last edited by

                          @unknownuser said:

                          Does PC SU and MacSU use the same Ruby version?
                          I don't know, but I often have problems...

                          @unknownuser said:

                          I can have a look on my own Mac when I get home.
                          Thank you !

                          @unknownuser said:

                          Hey, I notice you use $lg and then lg. Is it suppose to be two different things?
                          I will look in the code... Thank you!

                          Frenglish at its best !
                          My scripts

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            Got it nailed!

                            It's all down to line 69:

                            case Sketchup.active_model.options[0][2]
                            

                            On my mac it returned nil

                            Your case switch doesn't account for that value so lg is passed on as a string.

                            
                            case Sketchup.active_model.options[0][2]
                                when 0;lg = result[0].to_f
                                when 1;lg = result[0].to_f.feet
                                when 2;lg = result[0].to_f.mm
                                when 3;lg = result[0].to_f.cm
                                when 4;lg = result[0].to_f.m
                            end
                            
                            

                            My fix was to add a default handler for the switch.

                            
                            case Sketchup.active_model.options[0][2]
                                when 0;lg = result[0].to_f
                                when 1;lg = result[0].to_f.feet
                                when 2;lg = result[0].to_f.mm
                                when 3;lg = result[0].to_f.cm
                                when 4;lg = result[0].to_f.m
                                else  ;lg = result[0].to_f
                            end
                            
                            

                            Not sure why line 69 return nil though, didn't look into that.

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              Matt666
                              last edited by

                              Ok cool !! Thank you for your bug research Thomthom !
                              I am pretty sure it works if you try this code below

                              Sketchup.active_model.options["UnitsOptions"]["LengthUnit"]
                              

                              can you try it please ?

                              For "pl" variable, no problem. "$pl" is used to reuse last number entered in the polarline window...

                              Frenglish at its best !
                              My scripts

                              1 Reply Last reply Reply Quote 0
                              • thomthomT Offline
                                thomthom
                                last edited by

                                I'll try it and report back.

                                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

                                1 Reply Last reply Reply Quote 0
                                • thomthomT Offline
                                  thomthom
                                  last edited by

                                  Yes, that worked. πŸ‘

                                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                  List of my plugins and link to the CookieWare fund

                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    Matt666
                                    last edited by

                                    Thank you Thomthom!
                                    I've updated the first post... Can you try it on Mac please? Thank you!

                                    Frenglish at its best !
                                    My scripts

                                    1 Reply Last reply Reply Quote 0
                                    • EdsonE Offline
                                      Edson
                                      last edited by

                                      matt,

                                      now nothing happens at all. not even the request for the first point appears.

                                      edson mahfuz, architect| porto alegre β€’ brasil
                                      http://www.mahfuz.arq.br

                                      1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        Matt666
                                        last edited by

                                        😒 😒 😒
                                        Can you show me the error in the ruby console please?

                                        Frenglish at its best !
                                        My scripts

                                        1 Reply Last reply Reply Quote 0
                                        • EdsonE Offline
                                          Edson
                                          last edited by

                                          the console window was filled with a lot of stuff. this is the last piece. if you need the rest, let me know.


                                          Picture 13.png

                                          edson mahfuz, architect| porto alegre β€’ brasil
                                          http://www.mahfuz.arq.br

                                          1 Reply Last reply Reply Quote 0
                                          • M Offline
                                            Matt666
                                            last edited by

                                            😳 😳
                                            Excuse me Edson... A silly error... Shame on me !

                                            http://msnsmileys.net/p/smileys/Popo/Shame.png

                                            I updated the code...
                                            Sorry !

                                            Frenglish at its best !
                                            My scripts

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

                                            Advertisement