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!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Transformation in scale

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 365 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.
    • honoluludesktopH Offline
      honoluludesktop
      last edited by

      Can a transformation in scale be performed on a definition?

      Where t is a transformation making a bunch of entities 12 times bigger:

      #this enlarges my_instance my_definition = my_instance.transform!(t).definition repeat = false #this remains at the original size model.place_component my_definition, repeat

      I thought the first line above creates my_definition of the transformed my_instance, but it doesn't. How do I change the size of my_definition?
      my_definition  = my_instance.transform!(t).definition
      model.place_component my_definition, repeat

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

        #this enlarges my_instance my_definition = my_instance.definition my_definition.entities.transform!(t)

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

        1 Reply Last reply Reply Quote 0
        • honoluludesktopH Offline
          honoluludesktop
          last edited by

          Attached error message with the example:

          my_definition = my_instance.definition my_definition.entities.transform!(t)

          temp00.jpg
          I looked up entities, and tried the following. It runs, but without transformation to my_definition.

          my_definition = my_instance.definition my_definition.entities.transform_entities (t,my_instance) model.place_component my_definition

          Have been working on this off and on, for a couple of days. Something else must be going on????

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            To scale a definition, I think you have to scale its entities. The definition has to be at scale 1.0 I would guess. So to get it to be larger, scale all its entities.

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

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

              Sorry - posted in a rush - but you very nearly got there.
              my_definition.entities.transform_entities(t,my_definition.entities)

              (Avoid spaces between the methods name and the brackets)

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

              1 Reply Last reply Reply Quote 0
              • honoluludesktopH Offline
                honoluludesktop
                last edited by

                tt, and cf, Thanks. Got it to work as follows:

                my_definition.entities.transform_entities(t,my_definition.entities.to_a)

                Off and on for 4 days, this has got to be the longest time I've spent getting a single line of code right. Hopefully I'm getting better.

                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