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

    Edges: Remove any Material assigned to an edge?

    Scheduled Pinned Locked Moved Plugins
    20 Posts 5 Posters 2.4k Views 5 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.
    • JClementsJ Offline
      JClements
      last edited by

      Looking for a quick way to remove materials assigned to edges in a model.
      Is there a script that does this?

      If not, then would someone be willing to create one that could to the following:

      • If loose geometry is preselected then the script would remove the materials from visible edges.

      • If groups/components are preselected, then the script would recursively remove the material from all visible edges contained within the groups/components. The script would be context sensitive.

      • The script would not execute unless there was preselected geometry.

      John | Illustrator | Beaverton, Oregon

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

        Try putting this RB file into your Plugins folder.
        Restart SketchUp.
        To run it, type in the Ruby Console:
        TIG::DefaultEdges.now
        If it does what you want, then I can add a menu item, and RBZ etc...
        I haven't tested it extensively.......


        TIG-DefaultEdges.rb

        TIG

        1 Reply Last reply Reply Quote 0
        • JClementsJ Offline
          JClements
          last edited by

          That was quick. 😄 Your help much appreciated.

          Results were kind of hard to predict.
          Among other things, it has problem affecting all edges inside of a group or subgroups.

          Attached is my test file.

          Also noticed that when doing a Ctrl+Z (undo) that each segment of a circle had its material undone, one-at-a-time. If the code cycled through a sequence of a Select-All function, followed by a Deselect-Face, and then apply the Default Material ... would that be more efficient?

          Could the script be located in the EDIT menu and be display as "Edge Remove Material"?


          TEST su2018.skp

          John | Illustrator | Beaverton, Oregon

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

            You could edit the style and set edges to all the same.
            Edit:reading your post again I guess you don't want all edges to change.

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

              @John

              It was very basic - no undo etc, no menu...
              Give me a few minutes and I'll post an updated / improved version...

              TIG

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

                Here's a 'better' version...

                Please put the attached RB file into your Plugins folder and restart SketchUp.
                Please remove the earlier RB which is now redundant.

                The main changes are:

                File is renamed and © etc added to header.
                The tool is renamed "Remove Edge Material"
                It can now be run from an item of that name in the Edit menu [or run from the Ruby Console...]
                If there's preselected geometry including edges, or groups/component-instances, it processes the selection and as it completes it reports how many edges have had their material removed.
                If there is no suitable preselection an error message tells you and it aborts.
                The removal is one step undo-able.

                If it's doing what you want, then I can look at making it into an extension and packaging it in an RBZ etc...

                EDIT: RB file updated to fix typos !


                TIG-RemoveEdgeMaterial.rb

                TIG

                1 Reply Last reply Reply Quote 0
                • JClementsJ Offline
                  JClements
                  last edited by

                  I tested with SU2018.

                  It works as you mentioned in the above posting when a selected object is not in a group, but not recursively for any of selected groups or "subgroups" (all groups within selected group)

                  If you do a Select All and then run the script you'll see what I mean.

                  John | Illustrator | Beaverton, Oregon

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

                    Finally I see what's up !
                    I've corrected two stupid typos in my code and I now think it works OK.
                    I've swapped a working version of the RB in the recent post, please re-download/install and test...

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • JClementsJ Offline
                      JClements
                      last edited by

                      Thanks, TIG!

                      I also did a test of View > Hidden geometry with a Push-Pull circle. When turned ON, the smoothed edges were processed. When turned OFF, the smoothed edges maintained their existing material/color.

                      P.S.
                      Missed you at the BaseCamp 2018. It was quite good.

                      John | Illustrator | Beaverton, Oregon

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

                        The reason a surface's smoothed edges aren't process is because when you make a selection with View > Hidden Geometry > OFF they aren't in that selection.
                        And the tool processes a selection.
                        However, if it's View > Hidden Geometry > ON, then they'll get selected and will be processed.

                        So the correct usage is, if you want to process hidden/smoothed edges, first use View > Hidden Geometry > ON, then those edges can be in the selection selected.

                        PS: I was all geared up to go to Basecamp and Trimble had offered to pay for the flights and accommodation etc [as I'm a 'Sage'], however, the plan was also for my wife to go with me, but sadly she was unwell in the preceding weeks, so I had to cancel.
                        Maybe the next one...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • JClementsJ Offline
                          JClements
                          last edited by

                          @tig said:

                          So the correct usage is, if you want to process hidden/smoothed edges, first use View > Hidden Geometry > ON, then those edges can be in the selection selected.
                          ...

                          That is exactly what I was hoping for.

                          Hope hope your wife is feeling better.

                          John | Illustrator | Beaverton, Oregon

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

                            It would be possible to remove material from un-preselected 'hidden' edges [it already does that to any hidden edges inside preselected 'containers']
                            It first needs to assemble a list of all faces associated with the preselected edges, then it has to look at those edges and if any are hidden/smoothed etc and they have a material it is also removed - such hidden edges could be reported separately ?
                            So do you want it to do this ?
                            Do you want it to be optional - i.e. a Y/N dialog asks if any hidden edges might be processed ?
                            It could ask this in select geometry AND select containers...
                            I'll prepare a version for this...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • JClementsJ Offline
                              JClements
                              last edited by

                              Sure, a Yes/No would be fine. I hadn't considered that there would be away to do that.

                              John | Illustrator | Beaverton, Oregon

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

                                Try this attached version.
                                If your selected edges support faces which have some non-preselected hidden/smoothed edges, OR the preselected surface[s] have hidden/smoothed edges, which also have materials, then you are prompted to process them.
                                The closing Report dialog also lists how many of the processed edges were 'hidden/smoothed and non-preselected'...


                                TIG-RemoveEdgeMaterial.rb

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • JClementsJ Offline
                                  JClements
                                  last edited by

                                  Nice job.

                                  Seems to work well.

                                  Thanks, again.

                                  John | Illustrator | Beaverton, Oregon

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

                                    Can you put a little image for show what is a "material assigned to an edge" ?

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

                                    1 Reply Last reply Reply Quote 0
                                    • JClementsJ Offline
                                      JClements
                                      last edited by

                                      Palou:
                                      Download and install TIG's latest .rb file.

                                      Open the attached skp file

                                      View Scene 1 which has View Hidden Edges turned OFF and then Scene 2 which has View Hidden Geometry turned ON and notice that smoothed edges of the cylinder are colored red.
                                      edge colors.JPG

                                      While on Scene 1, select all the geometry, go the the Edit menu, TIG's plugin should be listed near the bottom of the menu, click on it and follow the instructions (Choose Yes to process hidden edges).

                                      Now go to Scene 2, and notice that the smoothed edges which were not visible in Scene 1 have been recolored to the Default edge color as well as all the other edges.

                                      TEST su2015.skp

                                      John | Illustrator | Beaverton, Oregon

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

                                        Thx very educative! 😎

                                        Remove edge material.jpg

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

                                        1 Reply Last reply Reply Quote 0
                                        • jujuJ Offline
                                          juju
                                          last edited by

                                          How often does everyone experience this problem where edges have materials applied?

                                          Save the Earth, it's the only planet with chocolate.

                                          1 Reply Last reply Reply Quote 0
                                          • JClementsJ Offline
                                            JClements
                                            last edited by

                                            I've noticed, mostly from models from the 3D warehouse or from folks new to SU, that there seems to have been unintended edge-coloring. Normally, I wouldn't have noticed, except when doing more "artzy" modeling or when emphasizing functional elements in the model such as process equipment and I turn on Edge Style > Color by Material.

                                            I know that I have often been in a hurry, triple-clicked surfaces or done a Select All and applied a material to edges mistakenly.

                                            So the script is handy for reviewing a model and doing a quick cleanup.

                                            John | Illustrator | Beaverton, Oregon

                                            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