sketchucation logo sketchucation
    • Login
    βŒ› Sale Ending | 30% Off Profile Builder 4 ends 30th September

    Useful formulas (that arent obvious)

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    8 Posts 5 Posters 1.8k Views 5 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.
    • R Offline
      remus
      last edited by

      Just thought it might be an idea to post up some of the little DC/maths tricks youve found that might be useful to other people.

      To start:

      =sqrt((x*x)+(y*y)+(z*z))
      

      gives the straight line distance from the model origin to the component origin.

      http://remusrendering.wordpress.com/

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

        Cool πŸ˜„

        1 Reply Last reply Reply Quote 0
        • J Offline
          James Fraser
          last edited by

          Maybe this is obvious, but helpful for those times when you can't see the wood for the trees. You could extend that to be the distance between two points by using (A!x - B!x) in place of x (same for y and z), where A and B are the two things in question.

          Obviously that would be the separation of the two axes rather than the gap between them, which would be complicated, except for special cases (like primitives).

          http://www.FormFonts.com

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

            It doesn't re-evaluate? I might have to look into this one when I get a chance. Thanks Remus!

            Chris

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

            1 Reply Last reply Reply Quote 0
            • R Offline
              remus
              last edited by

              I dont think it does...

              i'll check again though, just to make sure.

              http://remusrendering.wordpress.com/

              1 Reply Last reply Reply Quote 0
              • R Offline
                remus
                last edited by

                Good one james πŸ‘

                And another one, this time to assign an attribute a random value onclick, and doesnt reevaluate when referenced in other attributes.

                set("attribute",randbetween(x,y))
                

                Gives a random value netween x and y to attribute.

                http://remusrendering.wordpress.com/

                1 Reply Last reply Reply Quote 0
                • R Offline
                  remus
                  last edited by

                  No, it doesnt re-evaluate, as any formula that references "attribute" just references the value instead of the randbetween formula.

                  p.s. I thought it was you who showed me that trick...

                  http://remusrendering.wordpress.com/

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jsteacy
                    last edited by

                    ok, so I want to create an onclick random zig-zagging line. So each line is a component inside a larger component. The first line has a random number for rotation (randbetween(-3,3). For the next line to be placed at the end of first one after the rotation I need to reference the value of the randbetween. But when I do this it reference the code instead of the value so I get a completely different number where I want the end value. I tried the set("attribute"randbetween(x,y) but I either didn't put it in the right place or it's not the right thing to do. Can someone help?

                    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