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

    Replacing edges by components?

    Scheduled Pinned Locked Moved Developers' Forum
    17 Posts 6 Posters 809 Views 6 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.
    • cottyC Offline
      cotty
      last edited by

      For me this sounds like an extension of Chris Fullmers component stringer.

      my SketchUp gallery

      1 Reply Last reply Reply Quote 0
      • Wo3DanW Offline
        Wo3Dan
        last edited by

        @cotty said:

        For me this sounds like an extension of Chris Fullmers component stringer.

        I believe that 'Component Stringer' uses a curve or a selection of edges without 'side roads'
        I mean replacing geometry in in general, not necessarily along a string.
        As an example: the drawer of a cabinet, a concrete floor slab, an entire roof structure.
        3D Polylines display each in their own respective color while edges may be displayed 'all the same' (default black or changed to another overall color) at the same time.

        1 Reply Last reply Reply Quote 0
        • Wo3DanW Offline
          Wo3Dan
          last edited by

          @tig said:

          I wrote that very script for someone long long ago...
          It's in the PluginStore:
          http://sketchucation.com/pluginstore?pln=Lines2Components

          TIG, the suggested plugin seems to only replace vertical edges. Not an entire structure's edges.

          1 Reply Last reply Reply Quote 0
          • JQLJ Offline
            JQL
            last edited by

            1 Profile builder
            2 S4U to Components

            www.casca.pt
            Visit us on facebook!

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

              Could be as simple as this

              mod = Sketchup.active_model
              ent = mod.active_entities
              sel = mod.selection
              sel.empty? ? ents=ent.to_a ; ents=sel.to_a
              cdn = mod.definitions.reject{|cd|(cd.group?||cd.image?)}.map{|cd|cd.name}
              inp = UI.inputbox(["Component;"],[cdn[0]],"Edge to Component")
              if inp
              #assume that edge vector matches components z axis
               cd=mod.definitions[inp[0]];cl=cd.bounds.max.z
               ents.grep(Sketchup;;Edge).each{|e|
                tr1=Geom;;Transformation.scaling(1,1,e.length/cl)
                p,v=e.line;tr2=Geom;;Transformation.new(p,v)
                ent.add_instance(cd,tr2*tr1)
               }
              end
              
              

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

              http://sdmitch.blogspot.com/

              1 Reply Last reply Reply Quote 0
              • Wo3DanW Offline
                Wo3Dan
                last edited by

                @sdmitch said:

                Could be as simple as this.....(code above)

                Thank you Sam! Almost perfect.
                I "baptized" the code samuel.rb and tried it (in Plugin folder) in SketchUp 8
                It starts immediately with the template when opening SketchUp, .... then uses all the basic edges and also uses the first component in the 'In Model' component list. I can't seem to be able to use the plugin afterwards on a selection with the component of choice. Where do the plugin end up, like in which menu?
                How do I get it to work when using the program, not only when I start SketchUp?
                Is there any way to see the available 'In Model' component options to choose from?
                Also there is no 'Undo' this way?

                Thank you for taking the time to look at it!

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

                  That code was just a "snippet", not packaged as a Tool, not added to any menu or toolbar, and not installed as an extension. It just runs once as SketchUp loads it and then goes away. Needs some work to fill it out.

                  1 Reply Last reply Reply Quote 0
                  • Wo3DanW Offline
                    Wo3Dan
                    last edited by

                    @slbaumgartner said:

                    That code was just a "snippet", not packaged as a Tool, not added to any menu or toolbar, and not installed as an extension. It just runs once as SketchUp loads it and then goes away. Needs some work to fill it out.

                    I realized that it was too simple the way I did it. But that's what Sam wrote: "Could be as simple as this" 😮
                    These things aren't simple to me though. 😳

                    I then used AlexSchreyer's ruby code editor within SketchUp 2015 as a workaround, at least for me.
                    Once the code snippet is loaded it does the job on demand. Also with a redo available. So you'll just have to peek in the 'In Model' component library prior to making your choice.
                    I would prefere a plugin over the snippet though. Some interesting things you can achive with it, as mentioned before.

                    1 Reply Last reply Reply Quote 0
                    • Wo3DanW Offline
                      Wo3Dan
                      last edited by

                      @sdmitch said:

                      .... a complete plugin created from the snippet I previously posted. I gave the file the same name as you did so that it will replace the one in the plugins folder.....

                      I really appreciate it Sam, I just replaced the snipped rb in SketchUp 8's Plugin folder and it works as expected. Now I'll need to find where to put it in/for SketchUp 2015 where I never seem to be able to find where *.rb files are stored. My memory vaguely tells me that it isn't in the SketchUp main folder and isn't called Plugin anymore.

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

                        For 2014 and I'm guessing the same for 2015, the plugins are located in

                        "\AppData\Roaming\SketchUp\SketchUp 2014\SketchUp\Plugins" under your User Account.

                        In 2014 at least, the plugins folder wasn't automatically created for some reason so i had to create it.

                        This was a rather "quick and dirty" exercise so there will be things that need to be added or changed.

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

                        http://sdmitch.blogspot.com/

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

                          Post deleted.

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

                          http://sdmitch.blogspot.com/

                          1 Reply Last reply Reply Quote 0
                          • Wo3DanW Offline
                            Wo3Dan
                            last edited by

                            @sdmitch said:

                            For 2014 and I'm guessing the same for 2015, the plugins are located in

                            "\AppData\Roaming\SketchUp\SketchUp 2014\SketchUp\Plugins" under your User Account....

                            Thanks, yes I found it for SU2015.

                            Thanks again for the script, works great.
                            Here is a file with examples of the horrible 3D Polylines that I was trying to get into position.
                            These lines do have some advantages over edges in cases where inferencing is bothering you.


                            Some use of short straight "one segmented" colored 3D Polylines

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

                              @wo3dan said:

                              @sdmitch said:

                              For 2014 and I'm guessing the same for 2015, the plugins are located in

                              "\AppData\Roaming\SketchUp\SketchUp 2014\SketchUp\Plugins" under your User Account....

                              Thanks, yes I found it for SU2015.

                              Thanks again for the script, works great.
                              Here is a file with examples of the horrible 3D Polylines that I was trying to get into position.
                              These lines do have some advantages over edges in cases where inferencing is bothering you.

                              Great, I'm glad that it proved to be of some use. The version you have doesn't remove the edge and always just gives you the the first component in the definitions list. I have sent you, by Personal Message, a version that truly replaces the edge with the component as well as giving you a drop down list of all the components in the model to choose from.

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

                              http://sdmitch.blogspot.com/

                              1 Reply Last reply Reply Quote 0
                              • Wo3DanW Offline
                                Wo3Dan
                                last edited by

                                @sdmitch said:

                                Great, I'm glad that it proved to be of some use. The version you have doesn't remove the edge and always just gives you the the first component in the definitions list. I have sent you, by Personal Message, a version that truly replaces the edge with the component as well as giving you a drop down list of all the components in the model to choose from.

                                I'll try to look into it (the new version) tonight.
                                Great about the drop down list of components. My memory doesn't always recall which component to type in. Now I can create dashed lines and proper centerlines (and other types), sort of a library to choose from.

                                I may have one or two other suggestions:-

                                • (not always) delete the replaces edges, a choice so to speak.
                                • a choice whether all replacing components should be grouped or not. All 3D Polyline components into one big group (as visual reference) or not, by choice of the user.

                                But I'll have to see /experiment with converting floor plans, symbols etc. to see what works best.
                                And then I still have to rely on what you are willing to add.

                                If anyone has suggestions or hints, please post them here..

                                Thank you!

                                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