sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Lines to tubes

    Scheduled Pinned Locked Moved Plugins
    131 Posts 61 Posters 276.3k Views 61 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.
    • josephkim626J Offline
      josephkim626
      last edited by

      @sdmitch said:

      @josephkim626 said:

      As I am often giving precision 4 to give a rectangular look, im just wondering if there would be a way to rotate the profile 45 degrees. Effectively, having a rectangular tubes.

      Yes, but this particular plugin is scrambled so only the creator can make that change.

      In the mean time, maybe this will help. You can copy and paste into the Ruby Console to try it out.

      mod = Sketchup.active_model
      > ent = mod.active_entities
      > sel = mod.selection
      > unless sel.empty?
      >   vars=UI.inputbox(["Number of Sides;"," Length of a Side;","Angle of Rotation;"],[4,1,45],"Tube Specifications")
      >   if vars
      >     n,l,d=vars
      >     a=180/n
      >     r=l/Math.sin(a.degrees)/2
      >     edgs=sel.grep(Sketchup;;Edge)
      >     edgs.each{|e|
      >       p,v=e.line
      >       grp=ent.add_group;ge=grp.entities
      >       tube=ge.add_ngon(p,v,r,n)
      >       face=ge.add_face(tube)
      >       ent.transform_entities(Geom;;Transformation.rotation(p,v,d.degrees),face)
      >       face.followme e
      >       grp.explode
      >     }
      >   end
      > else
      >   UI.messagebox "Select Edges"
      > end
      > 
      

      Thank you so much, this helped for me at least this time.
      I had to remove "grp.explode" line as I wanted them to be a grouped members.
      who is the creator of this plugin? I know it has been tossed around couple times.
      (I will still need an option to use "mm" units, follow welded edges as solid)

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        Didier Bur is the creator of the "Lines2Tubes" plugin.

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • G Offline
          Guilherme Bera
          last edited by

          I'd like to thank you by this plugin.

          But it doesn't have a toolbar, and once that the plugin "Toolbar Editor" from Aerilius, induced me to make the workspace more visual. I decided to modify a bunch of scripts just enough to support toolbar, but your script is scrambled, so I can't do it by myself. So I'd be glad if you could modify your plugin just enough to support toolbar.

          Then a simple way to add the toolbar support is like TIG commented in another topic (bit.ly/29PAk6T😞

          @unknownuser said:

          An example of the menu making command is:

          unless file_loaded?(__FILE__)
          >    cmd = UI;;Command.new("SomeCommandName"){ SomeCommand.new() }
          >    UI.menu("Plugins").add_item(cmd)
          > ### START - ADD TOOLBAR HERE...
          > ### END -   ADD TOOLBAR HERE
          >    file_loaded(__FILE__)
          > end
          

          If it's a 'Tool' the CMD setup is slightly different...

          An example to use that within a toolbar is this additional code added between the ### markers:

          cmd.tooltip = "SomeCommandName"
          > cmd.status_bar_text = "SomeText"
          > cmd.small_icon = File.join("SomeCommandFolder/ImagesFolder", 'icon-24.png')
          > cmd.large_icon = File.join("SomeCommandFolder/ImagesFolder", 'icon-32.png')
          > toolbar = UI;;Toolbar.new("SomeCommandName")
          > toolbar.add_item(cmd)
          > toolbar.show if toolbar.get_last_state.abs == 1 # TB_VISIBLE/NEVER
          

          Note how addition properties are needed for the cmd to be used in a toolbar.
          The path to the button icons and their names is up to you...

          PS: If it could be helpful, I attached icons created for the toolbar.


          lines2tubes_32.png


          lines2tubes_24.png

          1 Reply Last reply Reply Quote 0
          • pilouP Offline
            pilou
            last edited by

            Does it possible to modify the plugin
            for have a rotation input?

            Now we have this!
            As you remark there is an Up Orientation!
            GIF_tube.gif

            Wanted! πŸ€“

            squares_w.jpg

            Frenchy Pilou
            Is beautiful that please without concept!
            My Little site :)

            1 Reply Last reply Reply Quote 0
            • josephkim626J Offline
              josephkim626
              last edited by

              @pilou said:

              Does it possible to modify the plugin
              for have a rotation input?

              Now we have this!
              As you remark there is an Up Orientation!
              [attachment=1:1rui9dug]<!-- ia1 -->GIF_tube.gif<!-- ia1 -->[/attachment:1rui9dug]

              Wanted! πŸ€“

              [attachment=0:1rui9dug]<!-- ia0 -->squares_w.jpg<!-- ia0 -->[/attachment:1rui9dug]

              Sdmitch has his own plugin that does what you are describing.

              http://sdmitch.blogspot.co.uk/

              find "Edge To Tube"

              1 Reply Last reply Reply Quote 0
              • josephkim626J Offline
                josephkim626
                last edited by

                @pilou said:

                Seems bugged! πŸ˜‰
                Or works only for curves ?
                Seems working only from polys of 5 segments! πŸ˜‰

                [attachment=1:17is50ip]<!-- ia1 -->GIF_bugged.gif<!-- ia1 -->[/attachment:17is50ip]

                Indeed it behaves funny when it is run on rectangles.

                But it seems fine for some others.

                [attachment=0:17is50ip]<!-- ia0 -->tube.gif<!-- ia0 -->[/attachment:17is50ip]


                tube.gif

                1 Reply Last reply Reply Quote 0
                • pilouP Offline
                  pilou
                  last edited by

                  Seems bugged! πŸ˜‰
                  Or works only for curves ?
                  Seems working only from polys of 5 segments! πŸ˜‰

                  GIF_bugged.gif

                  bugg4.jpg

                  Frenchy Pilou
                  Is beautiful that please without concept!
                  My Little site :)

                  1 Reply Last reply Reply Quote 0
                  • pilouP Offline
                    pilou
                    last edited by

                    The "Do curve" is somptuous! πŸ‘
                    (not my video πŸ’š
                    (currioussly don't works for the rectangles! 😲

                    Bravo to Sdmitch! 😎

                    Ps Will be very fine for any "section" πŸ˜‰

                    GIF_do_curve.gif

                    Frenchy Pilou
                    Is beautiful that please without concept!
                    My Little site :)

                    1 Reply Last reply Reply Quote 0
                    • ntxdaveN Offline
                      ntxdave
                      last edited by

                      One thing that does not work correctly for me is the Materials parameter. It will only allow me to select a material that has already been used in the model.

                      Maybe I am doing something wrong................

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        @ntxdave said:

                        One thing that does not work correctly for me is the Materials parameter. It will only allow me to select a material that has already been used in the model.
                        To give you access to the potentially thousands of material SKM files that are not currently used in the model could be unbelievably complex, even it it were easy to do in the API - which unfortunately it is not...
                        To be frank having any material choice seems overkill, as it is really a a geometry creator ?

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • sdmitchS Offline
                          sdmitch
                          last edited by

                          @josephkim626 said:

                          Indeed it behaves funny when it is run on rectangles.

                          But it seems fine for some others.

                          Fixed the problem with rectangles in my Edge_to_Tube plugin. Normal rectangles are bounded by 4 edges and not a 'curve' as polygons and circles are.


                          edge to tube.gif

                          Nothing is worthless, it can always be used as a bad example.

                          http://sdmitch.blogspot.com/

                          1 Reply Last reply Reply Quote 0
                          • pilouP Offline
                            pilou
                            last edited by

                            Excellent! πŸ‘

                            And can we imagine the same with any section ?

                            Frenchy Pilou
                            Is beautiful that please without concept!
                            My Little site :)

                            1 Reply Last reply Reply Quote 0
                            • R Offline
                              rv1974
                              last edited by

                              My $0.02:

                              1. Fredo's Make curves (weld)
                              2. S4u 'Make Frame'

                              GIF.gif

                              1 Reply Last reply Reply Quote 0
                              • pilouP Offline
                                pilou
                                last edited by

                                Yes but quid of differents number of segments of sections ? πŸ˜‰

                                @Sdmitch
                                Seems the "Do Curve" don't works in the new version!
                                Edit: Sorry I don't draw a polygon but a rectangle! 😳
                                The trick is draw a poly with 4 edges then resize with FredoScale! πŸ˜„

                                no_more.jpg

                                no_curve1.jpg

                                Frenchy Pilou
                                Is beautiful that please without concept!
                                My Little site :)

                                1 Reply Last reply Reply Quote 0
                                • fionmacoolF Offline
                                  fionmacool
                                  last edited by

                                  Merci pour le Plugin. : )

                                  Zere are still some architectes zat do not know ow to use ze SketchUp..... Zis is unbelievable....

                                  1 Reply Last reply Reply Quote 0
                                  • H Offline
                                    huajiet
                                    last edited by

                                    @sdmitch said:

                                    Yes, but this particular plugin is scrambled so only the creator can make that change.

                                    I'm hoping to set the default 'Precision' input at 20. looked into the .rb file but it's all scrambled. anyone can help?

                                    sdmitch, where can I download your Edge_to_Tube plugin?

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

                                      How do you download the extension

                                      1 Reply Last reply Reply Quote 0
                                      • Didier BurD Offline
                                        Didier Bur
                                        last edited by

                                        Hi,
                                        Go to the Resources tab and select the PluginStore option.
                                        Regards

                                        DB

                                        1 Reply Last reply Reply Quote 0
                                        • S Offline
                                          samodelkin_77
                                          last edited by

                                          @huajiet said:

                                          @sdmitch said:

                                          I'm hoping to set the default 'Precision' input at 20. looked into the .rb file but it's all scrambled. anyone can help?

                                          look at this plugin:

                                          https://transfiles.ru/lwtkd

                                          1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            samodelkin_77
                                            last edited by

                                            and how to insert images when responding? I didn't find where to click.press. I had to upload it to a file sharing service..

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

                                            Advertisement