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!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Select identical components in identical positions

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    2 Posts 2 Posters 161 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.
    • C Offline
      camncam
      last edited by

      I apologize if this has already been asked. I searched but came up with nothing.
      I would like to be able to check my model for identical instances of components in identical positions. The purpose is a check that I haven't placed the same component over another with the Mirror plugin or similar before I generate a .csv report to quantify my components.

      Thanks in advance for your replies.

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

        This is a 'duplicate check' πŸ˜•
        It's straightforward for objects that are instances of the same component with the same insertion point / transformation, in the same context... copy/paste+<enter> this one-liner in the Ruby Console - it works on a selection containing component-instances...

        m=Sketchup.active_model;s=m.selection;a=s.grep(Sketchup;;ComponentInstance);s.clear;d=[];a.each{|i|next unless i.definition.instances[1];t=i.transformation.to_a;(i.definition.instances-[i]).each{|e|(d<<i;s.add(e))if !d.include?(e) && e.transformation.to_a==t && e.parent.entities==m.active_entities;};};
        

        The duplicates are highlighted on completion. If you start with Entity Info open it will show what's selected still etc... Pressing <delete> when the SketchUp window has focus will remove the duplicated item...

        It gets more tricky when they are 'symmetrical' and perhaps placed overlaid 'handed' - therefore with different insertion points but seemingly occupying the same volume.
        A matching bounding-box check could work BUT is not foolproof... I think thomthom might have done something like this ? Do a search...

        TIG

        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