sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    I want to force a maximum, but how?

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    8 Posts 3 Posters 1.3k 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.
    • pyrolunaP Offline
      pyroluna
      last edited by

      I thinks this should be possible, but I'm not sure. At the very least, I don't know how.
      I want users to be able to input a value (in cm) but I want it to be limited between zero and a specific length or angle, which I am using later on for positioning a subcomponent.
      Who can help me?

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

        I'm not sure it can be done. The first thing that came to mind was this:

        Value: =smallest(max_value, =current(Value))

        But this results ins a circular reference.

        So then I thought you to use a second attribute:

        Value: (User Input Box) Real_Value: =smallest(max_value, Value)

        But this won't update the user input dialog. I don't know.

        Hi

        1 Reply Last reply Reply Quote 0
        • pyrolunaP Offline
          pyroluna
          last edited by

          thanks for trying Jim... that's what I had come up with myself. But I had thought there would be a in-built function for such a thing. I had first planned to do a drop-down with pre-set values, but the client wanted to be able to set the values steplessly... difficult!! Well. Maybe I'll do a very long drop-down πŸ˜†

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

            Would something like this do the trick?

            It is a workaround, and it may have some implication on how easy the DC is to configure for the end user.

            dc1.png

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

              I just read back over your posts. I should have picked up that you were looking for something other than a workaround. What did you end up doing?

              1 Reply Last reply Reply Quote 0
              • pyrolunaP Offline
                pyroluna
                last edited by

                I ended up using a solution similar to yours.
                I am now, however, bumping into another problem altogether. In subcomponents, more than a few levels down, a rotation by zero results in a different location of the component than a rotation by... zero! The geometry jumps all over the place. It's bugging me

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

                  Hmm. I don't know if it was the same issue, but I've had something similar happen.

                  I had no subcomponents, and I had user input controlling the RotX and RotY attributes. I didn't have the RotZ attribute enabled in DC at all.

                  If the user rotated the DC about the Z axis (using the rotate tool, not the DC options box), the RotZ would always jump back to 0 upon redraw.

                  Is this similar to what you're experiencing?

                  1 Reply Last reply Reply Quote 0
                  • pyrolunaP Offline
                    pyroluna
                    last edited by

                    Hm no not exactly. But I've figured out what went wrong. Sort of.
                    It went like this. Everything was fine until I added a custom variable. At that moment (or some other similar actions), either the parent component or the component itself would jump to a different location.
                    I was baffled at first, but discovered that when I changed the user input, thus forcing SU to recalculate the entire component, everything went back into place. So it's quite irritable to work with, but the error will never occur when the user uses the component β˜€

                    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