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

    DC "Flipping" Script

    Scheduled Pinned Locked Moved Plugins
    19 Posts 2 Posters 1.3k Views 2 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.
    • E Offline
      ericschimel
      last edited by

      Ok, so here's a fairly basic DC. If I change the axis of the DC, it "blows up" because all of the formula's are referencing an axis that has changed.

      Pull this into your model, and use it to see how it works. Then, right click on it, and change the orientation of the axis and then try to use it again, you'll see what happens.


      E2000 Left Mitre.skp

      -Eric
      http://plugin.sketchthis.net
      Sketchup Kitchen Design Plugin
      Custom Models

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

        Will look at it.
        (Sorry - been a wee bit busy)

        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

          hmm.. are we talking about just flipping, or adjusting axis completely?
          Is it swapping X for Y or Z etc?

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

          1 Reply Last reply Reply Quote 0
          • E Offline
            ericschimel
            last edited by

            Lets say you took the above DC and rotate the axis about the Blue axis. In other words, you switched the direction of the green and red axis, leaving the blue one in the same direction. For the DC not to "Blow up" you'd need to switch every Red axis formula with Green axis references and vica versa, leaving the blue ones alone.

            Doing this manually is really tedious and dangerous, even on a simple DC such as this one.

            -Eric
            http://plugin.sketchthis.net
            Sketchup Kitchen Design Plugin
            Custom Models

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

              Ok - that's an easier scope. Arbitrary change of the axis would appear awfully complex. Even flipping, mirroring appear to be a bit of a problem. But axis swapping should be doable without too much fuzz. (famous last words...?)

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

              1 Reply Last reply Reply Quote 0
              • E Offline
                ericschimel
                last edited by

                Ok, I am seeing what you are thinking. Flipping would be awesome, because then, like I said, I could change the gluing plane of DC's without having to rebuild them.

                Later on, something that would mirror DC's would be killer, but that's a lot of math to wrap your brain around! (and how do you change small sections of formulas, instead of just swapping them around?)

                -Eric
                http://plugin.sketchthis.net
                Sketchup Kitchen Design Plugin
                Custom Models

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

                  @unknownuser said:

                  (and how do you change small sections of formulas, instead of just swapping them around?)

                  That'd be the key problem. To interpret forums. Just seem all too complex.

                  But let's have a look at swapping axis orientation.

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

                  1 Reply Last reply Reply Quote 0
                  • E Offline
                    ericschimel
                    last edited by

                    That would be really cool if axes could be rotated....

                    As far as changing snippets of formulas, is it impossible with the API, or just really friggin hard?

                    -Eric
                    http://plugin.sketchthis.net
                    Sketchup Kitchen Design Plugin
                    Custom Models

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

                      @unknownuser said:

                      As far as changing snippets of formulas, is it impossible with the API, or just really friggin hard?

                      It's easy if you know what to change. But the formula is basically source code and they can appear in so many mutations, you'd have to make the script be able to understand what the formula do, its intention.

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

                      1 Reply Last reply Reply Quote 0
                      • E Offline
                        ericschimel
                        last edited by

                        Ahh ok, but a script that would say go through a change all the "LenX" references to "LenY" references would be fairly easy?

                        -Eric
                        http://plugin.sketchthis.net
                        Sketchup Kitchen Design Plugin
                        Custom Models

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

                          Yea - much easier.
                          But, what about sub-components? If you have multiple depths with components?

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

                          1 Reply Last reply Reply Quote 0
                          • E Offline
                            ericschimel
                            last edited by

                            Oh yeah, there are always sub components, that's what makes this so hard to do. If I was just changing top level stuff, the script wouldn't be needed.

                            -Eric
                            http://plugin.sketchthis.net
                            Sketchup Kitchen Design Plugin
                            Custom Models

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

                              Yea, but a the sub-components could themselves be DC's - would one have to flip the axis of these as well? Or would things work find if one only processed the first level of sub-components?

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

                              1 Reply Last reply Reply Quote 0
                              • E Offline
                                ericschimel
                                last edited by

                                As far as sub components, it would be any sub components that reference the axis of the most top level component. And sub component that references an axis from another sub component that is below the top level wouldn't need to be changed.

                                -Eric
                                http://plugin.sketchthis.net
                                Sketchup Kitchen Design Plugin
                                Custom Models

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

                                Advertisement