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

    Delete a material that's being used (using Ruby)

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 5 Posters 355 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.
    • F Offline
      fizgig
      last edited by

      Any way to do this?

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

        there isn't any mathods to delete materials. the workaround is to create temprary geoemtry and apply all others materials to it, then purge materials. But you must also make sure that the material you want to purge isn't the current one.

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

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

          No. (I say that with no confidence. Never say never.)

          If you paint a face with a color that's not in Materials, it's still not in Materials and you are not far from Bug Splat. I've not traced this to some particular combination, but it's regular, if not repeatable.

          Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

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

            I have written a material.delete additional method... ThomThom helped - memory loss ?

            http://forums.sketchucation.com/viewtopic.php?p=166978#p166978

            It will erase a material - if it's current it 'defaults' objects with that material...

            TIG

            1 Reply Last reply Reply Quote 0
            • tridemT Offline
              tridem
              last edited by

              @thomthom said:

              there isn't any mathods to delete materials. the workaround is to create temprary geoemtry and apply all others materials to it, then purge materials. But you must also make sure that the material you want to purge isn't the current one.

              πŸ˜• maybe i'm misunderstanding, but although I don't have any dedicated ruby-script, by right click on the material I can delete and replace with the default one

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

                @tridem said:

                @thomthom said:

                there isn't any mathods to delete materials. the workaround is to create temprary geoemtry and apply all others materials to it, then purge materials. But you must also make sure that the material you want to purge isn't the current one.

                πŸ˜• maybe i'm misunderstanding, but although I don't have any dedicated ruby-script, by right click on the material I can delete and replace with the default one

                You CAN easily do it manually - but to do it within a script is not available in the current API - hence my additional method material.delete which mimics that manual operation...

                TIG

                1 Reply Last reply Reply Quote 0
                • tridemT Offline
                  tridem
                  last edited by

                  @tig said:

                  .. but to do it within a script ..

                  doh! .. actualy for me it's time to go to sleep πŸ˜†

                  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