sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    FredoBend | Powerful new bending tool for SketchUp Download

    Apply material to group/model with same volume

    Scheduled Pinned Locked Moved Plugins
    2 Posts 2 Posters 276 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.
    • NithinN Offline
      Nithin
      last edited by

      Is there plugin which applies the material/texture to groups of same volume.

      The idea is similar to coreldraw's "copy properties from", in which it will ask for source object from where properties has to be copied.

      why volume?
      It can be applied by group's name also but it might be possible that after making cloning of groups some of them might be intentionally modified(but name of that group might not been changed) in size.

      where it can be use?
      usually where groups/models are cloned ex. windows,doors,windows glass etc.

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

        Try something like this

        m=Sketchup.active_model;ms=m.materials;gs=m.active_entities.grep(Sketchup;;Group);m.start_operation('vmat');gs.clone.each_with_index{|g,i|next unless gs.include?(g);v=g.volume;(gs.delete(g);next)if v<=0;g.material=(ma=ms.add('vmat#1'));ma.color=[rand(255),rand(255),rand(255)];ma.alpha=0.5;gs.clone.each{|gg|(gg.material=ma;gs.delete(gg))if gg.volume==v};};m.commit_operation;
        

        This colors all groups in the active context which share the same volume, in a new random material [alpha=0.5]...
        Non-solid groups [volume <=0... usually -1] are ignored... πŸ˜„

        TIG

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better πŸ’—

        Register Login
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement