sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    Transformation in scale

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 304 Views
    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