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

    Always face center-line/ Magnetic tool

    Scheduled Pinned Locked Moved Plugins
    56 Posts 9 Posters 2.2k Views 9 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.
    • Flippie123F Offline
      Flippie123
      last edited by

      Hi Jeff, I'm not trying to compete with Zaha. I have been using sketchup since the very beginning. In the beginning I started to do some simple architecture using sketchup but now years later I'm doing some pretty advanced architecture designs using sketchup where I'm trying to reach the limits of the program.

      I'm very exited about sketchup2015 because the 64bit version makes much more possible.

      Off course I can use Rhino to do some modelling. But at the end my clients want to see a Sketchup model because for them a sketchup model is easy to read.

      @jeff hammond said:

      @flippie123 said:

      I did some experimenting with the pathcopy tool and some curved lines. I used 2 magnetic points here. But it will become really interesting if I can add 3,4 or 5 magnetic points.

      I'm just a user...not a developer, but I can assure everyone that we are using sketchup to make the most awesome architecture here in our office.

      don't you guys have a copy of rhino in your office?
      i'm pretty sure zaha used paneling tools to create this.. possibly in conjunction with a custom script..
      it's super powerful for various types of attractors etc..

      [attachment=0:ddwi3rqq]<!-- ia0 -->Screen Shot 2014-12-10 at 10.59.16 AM.png<!-- ia0 -->[/attachment:ddwi3rqq]


      @box said:

      On a side note, there is always Sketchy Physics for using Magnetism.[...]
      But it's a magnetic thread so I had to do something.

      heh.. neat ☀

      1 Reply Last reply Reply Quote 0
      • jeff hammondJ Offline
        jeff hammond
        last edited by

        @flippie123 said:

        Hi Jeff, I'm not trying to compete with Zaha. I have been using sketchup since the very beginning. In the beginning I started to do some simple architecture using sketchup but now years later I'm doing some pretty advanced architecture designs using sketchup where I'm trying to reach the limits of the program.

        I'm very exited about sketchup2015 because the 64bit version makes much more possible.

        Off course I can use Rhino to do some modelling. But at the end my clients want to see a Sketchup model because for them a sketchup model is easy to read.

        my bad.. i suppose i read too literally when you posted her model saying 'i want to make this'


        here are a couple example DC files showing attractor type stuff in sketchup.. maybe some ideas will spring from them:

        created by sketchucation member TAEKLE

        dc_attract.jpg

        dotdotdot

        1 Reply Last reply Reply Quote 0
        • jeff hammondJ Offline
          jeff hammond
          last edited by

          here's possibly the most basic dynamic component ever made 😄

          DC_pointer.skp


          it's a one liner:
          Screen Shot 2014-12-10 at 11.52.25 PM.png

          just use the regular Move tool to move it around and make copies (though doesn't seem to work with copy/array)?.. it will always point at the origin.
          (as is, you have to stay on the positive side of the red axis or it will point backwards)

          Screen Shot 2014-12-10 at 11.51.58 PM.png

          dotdotdot

          1 Reply Last reply Reply Quote 0
          • Flippie123F Offline
            Flippie123
            last edited by

            @jeff hammond said:

            here's possibly the most basic dynamic component ever made 😄

            haha...yes it always point to the center line but it is not magnetic. I tried to use the sketchyphysics tool but it only works for Sketchup7. And it is not easy to use. 🎉

            1 Reply Last reply Reply Quote 0
            • jeff hammondJ Offline
              jeff hammond
              last edited by

              @flippie123 said:

              haha...yes it always point to the center line but it is not magnetic.

              hmm.. it was meant as proof of concept.. the origin in this case is "magnetic"..

              copy a bunch of them around:

              Screen Shot 2014-12-11 at 3.00.49 AM.png

              then select them all and move them at once:

              Screen Shot 2014-12-11 at 3.01.19 AM.png

              Screen Shot 2014-12-11 at 3.01.37 AM.png

              with a less simple DC, you could make it the other way.. the objects stay put and you move the attractor around (though probably moving the the attractor via numerical input).

              dotdotdot

              1 Reply Last reply Reply Quote 0
              • BoxB Online
                Box
                last edited by

                @flippie123 said:

                I tried to use the sketchyphysics tool but it only works for Sketchup7. And it is not easy to use. 🎉

                My model up there was done in 2015 32bit, the only version it doesn't work in at the moment is 2015 64bit. Make sure you are using the latest version.

                Yes it can be difficult to use, it isn't the most easily understood plugin and the documentation is limited.

                But mostly I don't think it would work for you as it doesn't really work for positioning stuff then placing it. It is more of an animation tool.

                1 Reply Last reply Reply Quote 0
                • cottyC Offline
                  cotty
                  last edited by

                  @flippie123 said:

                  ... but it only works for Sketchup7. And it is not easy to use. 🎉

                  That's wrong...
                  http://sketchucation.com/pluginstore?pln=SketchyPhysics

                  my SketchUp gallery

                  1 Reply Last reply Reply Quote 0
                  • jeff hammondJ Offline
                    jeff hammond
                    last edited by

                    .

                    here's a dynamic component which does the thing in the original post..

                    DC_Magnet.skp

                    to use it:
                    • double-click the outer component (main) to enter it.. (there are two more components inside: box & attractor)
                    • Move the attractor component with the move tool
                    • exit the main component then right-click on it --> Dynamic Components-> Redraw.

                    dotdotdot

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      @jeff
                      that's really good...

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • jeff hammondJ Offline
                        jeff hammond
                        last edited by

                        @driven said:

                        @jeff
                        that's really good...

                        thanks.


                        a few more additions (right-click--> dynamic components -> component options)

                        • pick the number of boxes (square array)
                        • how many beers? (straightness of rows and columns waver)

                        DC_Magnet_Beer.skp

                        Screen Shot 2014-12-11 at 11.16.14 PM.png

                        dotdotdot

                        1 Reply Last reply Reply Quote 0
                        • jeff hammondJ Offline
                          jeff hammond
                          last edited by

                          .

                          1024 boxes, a 12-pack, and change the shape of the box component

                          beermag.jpg

                          dotdotdot

                          1 Reply Last reply Reply Quote 0
                          • Flippie123F Offline
                            Flippie123
                            last edited by

                            @Jeff

                            I just made this and gave it a twist. Very awesome! 🎉 👍


                            Capture4.JPG

                            1 Reply Last reply Reply Quote 0
                            • jeff hammondJ Offline
                              jeff hammond
                              last edited by

                              @flippie123 said:

                              I just made this and gave it a twist.

                              yeah, it's something to do with replacing the box component with one on a different axis.. haven't quite figured out how to control it properly.. i made it this far:

                              beermag2.jpg

                              dotdotdot

                              1 Reply Last reply Reply Quote 0
                              • jeff hammondJ Offline
                                jeff hammond
                                last edited by

                                sweet!
                                (i'm not sure how to use the code but the gif looks cool 😉 👍 )

                                dotdotdot

                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  driven
                                  last edited by

                                  @jeff hammond said:

                                  ...i'm not sure how to use the code ...

                                  just paste into 'Ruby Console' hit return, will run till end of session...
                                  it's only active when inside the DC so you can do other modelling...

                                  I can put it in a rbz with the DC if you want...

                                  john

                                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                                  1 Reply Last reply Reply Quote 0
                                  • jeff hammondJ Offline
                                    jeff hammond
                                    last edited by

                                    @driven said:

                                    @jeff hammond said:

                                    ...i'm not sure how to use the code ...

                                    just paste into 'Ruby Console' hit return, will run till end of session...
                                    it's only active when inside the DC so you can do other modelling...

                                    I can put it in a rbz with the DC if you want...

                                    john

                                    oh nice. i see now.
                                    it works along with the dynamic component i posted.. i didn't realize things like that were possible.

                                    but yeah, that's a lot better than manually triggering the redraw 👍

                                    dotdotdot

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      driven
                                      last edited by

                                      @jeff hammond said:

                                      ... i didn't realize things like that were possible.

                                      nor did I...

                                      I improved the script to only do one redraw after the move [was trigging twice]...

                                      there are probably other ways to do this, but it seams to work...

                                      john

                                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        driven
                                        last edited by

                                        updated working version...

                                        class JcB_MoveToolObserver < Sketchup;;ToolsObserver
                                            def onToolStateChanged(tools, tool_name, tool_id, tool_state)
                                              attractor = Sketchup.active_model.selection[0].definition.name == 'attractor'
                                              moved = tool_state.to_s == '0' && tool_name.to_s == 'MoveTool'
                                              @count = 0 unless @count == 1
                                              
                                              update = attractor && moved
                                                if update
                                                  selection = Sketchup.active_model.selection[0].parent.instances[0]
                                                  @count = @count + 1
                                                  puts(" first click of " + tool_name.to_s ) if @count == 1
                                                  if @count == 2
                                                    puts(" second click of " + tool_name.to_s )
                                                    $dc_observers.get_latest_class.redraw_with_undo(selection)
                                                    @count = 0
                                                  end
                                                end
                                            end
                                         end
                                        
                                         Sketchup.active_model.tools.add_observer(JcB_MoveToolObserver.new) if not defined? JcB_MoveToolObserver
                                         
                                        

                                        learn from the mistakes of others, you may not live long enough to make them all yourself...

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          driven
                                          last edited by

                                          here's a fun bit of code...
                                          now it does what the OP asked...
                                          auto update, slows a bit over 64 items...

                                           look below...
                                          

                                          john
                                          EDIT: changed back to original as my counter was failing

                                          BETTER CODE BELOW...

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                                          1 Reply Last reply Reply Quote 0
                                          • J Offline
                                            Jim
                                            last edited by

                                            @unknownuser said:

                                            the other thing I was wondering if arrow keys can be used to move the dc's 'attractor'

                                            You need a Tool to get the key-presses, then read-update-write the position values depending on which key was pressed, then redraw the DC.


                                            This file was made specifically for Jeff's DC Magnet Beer model.

                                            Hi

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

                                            Advertisement