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

    [REQ] Scale Definition

    Scheduled Pinned Locked Moved Plugins
    6 Posts 3 Posters 2.1k Views 3 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.
    • PixeroP Offline
      Pixero
      last edited by

      Is there a plugin that iterates through the selection and makes each group a component and then scales it's definition?
      (I have some imported Revit geometry that causes problems.)

      Edit: If it's a component already it would just scale the definition.

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

        tr=Geom;;Transformation.scaling(ORIGIN,10,10,10);Sketchup.active_model.selection.to_a.each{|e|next if e.class!=Sketchup;;Group;n=e.name;n='G'if n=='';i=e.to_component;i.name=n;d=i.definition;d.name=n;d.entities.transform_entities(tr,d.entities.to_a)}
        

        This makes every selected group into a component [named after the group, or G/G#1/etc if it's unnamed], with the same name, and scales the definition x10 about it's insertion point [ORIGIN] - change those values to suit yourself...

        EDIT: for a component use this

        tr=Geom;;Transformation.scaling(ORIGIN,10,10,10);Sketchup.active_model.selection.to_a.each{|e|next if e.class!=Sketchup;;ComponentInstance;d=e.definition;d.entities.transform_entities(tr,d.entities.to_a)}
        

        TIG

        1 Reply Last reply Reply Quote 0
        • PixeroP Offline
          Pixero
          last edited by

          @tig said:

          tr=Geom;;Transformation.scaling(ORIGIN,10,10,10);Sketchup.active_model.selection.to_a.each{|e|next if e.class!=Sketchup;;Group;n=e.name;n='G'if n=='';i=e.to_component;i.name=n;d=i.definition;d.name=n;d.entities.transform_entities(tr,d.entities.to_a)}
          

          This makes every selected group into a component [named after the group, or G/G#1/etc if it's unnamed], with the same name, and scales the definition x10 about it's insertion point [ORIGIN] - change those values to suit yourself...

          EDIT: for a component use this

          tr=Geom;;Transformation.scaling(ORIGIN,10,10,10);Sketchup.active_model.selection.to_a.each{|e|next if e.class!=Sketchup;;ComponentInstance;d=e.definition;d.entities.transform_entities(tr,d.entities.to_a)}
          

          I meant "Scale Definition" as in right clicking a component and selecting it from the pop up menu. No idea what scale number to use. One?

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

            Aha...
            You mean scale the definition to match the current instance's scale ?
            In that case it's a bit more complicated and simpler at the same time! ...
            If it's a scaled group it will convert to a component instance at its current scaling - but the definition will be the original size. The quick fix is to clone the group inside a new group of the same name, and erase the original group, then explode the clone within the new group so its scaling gets 'frozen', THEN make that group into a component that is no longer scaled and the current size instead

            m=Sketchup.active_model;m.start_operation('X');m.selection.to_a.each{|e|next if e.class!=Sketchup;;Group;n=e.name;n='G'if n=='';g=m.active_entities.add_group;t=g.entities.add_instance(e.entities.parent,e.transformation);e.erase!;t.explode;i=g.to_component;i.name=n;d=i.definition;d.name=n};m.commit_operation
            

            If it's already an instance we can use

            m=Sketchup.active_model;m.start_operation('X');m.selection.to_a.each{|e|next if e.class!=Sketchup;;ComponentInstance;d=e.definition;n=e.name;g=m.active_entities.add_group;t=g.entities.add_instance(d,e.transformation);e.erase!;t.explode;i=g.to_component;dd=i.definition;d.instances.each{|ii|ii.definition=dd};d.name=n+rand.to_s;dd.name=n;d.entities.erase_entities(d.entities.to_a)};m.commit_operation
            

            This makes all instances of a definition the same ? Do you only get one of each from Revit ??

            TIG

            1 Reply Last reply Reply Quote 0
            • PixeroP Offline
              Pixero
              last edited by

              Thanks, this seemed to work. 👍

              The problem was that the groups was in some huge scale so "opening" a group would cause clipping to go haywire and also textures had to be enormous in scale.

              1 Reply Last reply Reply Quote 0
              • D Offline
                DOD3R
                last edited by

                I would appreciate an option to scale all components definition to their current scale.
                Is there some plugin for that or any other way of doing it component by component ?

                I have problems with large dwg imports after I scale the to desired size. Formal dwg block imported to sketchup as components are all scaled and I need to manually scale their definitions witch can by labor-some.

                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