sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    CURRENT to snap - not working

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    4 Posts 2 Posters 867 Views 2 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.
    • D Offline
      duke
      last edited by

      I'm having a bit of problem using this extremely useful function. I've uploaded an example where there are boxes that copy according to length, and a beam that's length is determined by...the overall length. I've put the CURRENT function in the overall LenX as I've seen done, but it's not working as expected. Am I doing something wrong?

      favicon

      (www.dukecg.net)

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

        Unfortunately I don't have SU7 available right now. So I'll write it out as I use it.

        LenX=round(current("LenX")/10)*10

        I think that is the right syntax. The idea is that the current LenX (we'll say 12) gets divided by 10 (the number we want to snap to). The answer is 1.2. That gets rounded to 1. Then multiplied by 10. So LenX = 10 after all the math gets run.

        Does that help?

        Chris

        BTW, there seems to be a glitch if you are working in cm. The current Lenx is always in inches, even if the model units are cm and the Dc units are cm. In the case of using cm, you need to use:

        LenX=round(current("LenX")*2.54/10)*10. So if the user scales to 12 cm, the currentLenx is actually only 4.72 inches. So multiply it by 2.54 first, to convert it into cm. Then you will have 12/10 to equal 1.2. Then that gets rounded down to 1. Then multiplied up to 10cm.

        I hope that helps and I hope I got the syntax right w.o su7 in front of me.

        Chris

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

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

          Thanks Chris. I'll check this out tonight.

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

            Thanks Chris! That worked. Would have never had known there was an issue.

            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