JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Dynamically updating the parameter array returned by getParameterDefinitions() ?

    General Discussions
    5
    9
    1129
    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.
    • udif
      udif last edited by

      Is there a way to dynamically update the parameter window, so I could write a simple GUI that dynamically adds or removes parameters?

      z3dev hrgdavor 2 Replies Last reply Reply Quote 0
      • Antoine Guillaume
        Antoine Guillaume @hrgdavor last edited by

        @hrgdavor for the moment i have create only one field and i serialize all datas of form and i check the values in the openjscad script

        1 Reply Last reply Reply Quote 0
        • hrgdavor
          hrgdavor @Antoine Guillaume last edited by

          @antoine-guillaume this could be done by adding support for a second function getDynamicParameters where:

          • firstly getParameterDefinitions is called and a list of basic parameters is generated and remembered
          • secondly getDynamicParameters is called but with the values from the form and it provides more inputs
          • on any change to base parameters, getDynamicParameters is called again with changed values to regenerate dynamic list of inputs

          if there are ppl interested in this feature please open an issue or a discussion where we could define a feature like this. This is something I could implement relatively easy in my new prototype, but is unlikely I would have patience to buid it ony the current jscad web from master branch.
          https://github.com/jscad/OpenJSCAD.org/discussions/944

          Antoine Guillaume 1 Reply Last reply Reply Quote 0
          • Antoine Guillaume
            Antoine Guillaume last edited by Antoine Guillaume

            Hello, sorry for the delay, I had not seen your messages....
            The idea is to vary the parameters according to the parameter entered previously.
            As is, this is not possible due to the getParameterDefinitions function.

            hrgdavor 1 Reply Last reply Reply Quote 0
            • gilboonet
              gilboonet @Antoine Guillaume last edited by

              @antoine-guillaume Hello, you can do whatever you want into getParameterDefinitions() but due to code cinematic you won't be able to use parameters value for that. For scripts that use variable number of parameters, I use text parameters and enter multiple values on them using separators, semi-comma between sets of parameters and comma between values (when some are optional). And at runtime I parse the text parameters (using split()) to get needed data.

              1 Reply Last reply Reply Quote 1
              • z3dev
                z3dev @Antoine Guillaume last edited by

                @antoine-guillaume welcome

                You can create a custom webpage from the JSCAD components, but there’s a learning curve.

                The website is very specialized, and contains a lot of functionality. For example, passing URL of online designs.

                I think that other users can assist if you provide a few more details on your ideas.

                1 Reply Last reply Reply Quote 0
                • hrgdavor
                  hrgdavor @udif last edited by

                  @udif perhaps add an issue on git, with examples what you would like to do with parameters, we could discussit there a bit more, and maybe come-up with some ideas.

                  This is not something possible right now, so it could be a feature request.

                  1 Reply Last reply Reply Quote 0
                  • Antoine Guillaume
                    Antoine Guillaume last edited by

                    Hello,
                    i have a similar query.
                    I develop an application allow to a user add many hole.
                    The user specify the number of hole (X) in parameters and i want to show in parameters X times the coordinate of the hold.
                    How i add dynamicaly in getParameterDefinitions?

                    Thanks

                    z3dev gilboonet 2 Replies Last reply Reply Quote 0
                    • z3dev
                      z3dev @udif last edited by

                      I was hoping that some other users would provide a few hints, as there have been some custom web applications created.

                      Do you have some idea as to what you want to achieve?

                      You won’t be able to do any of these specializations using the JSCAD website, as that special handling of parameters.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Powered by NodeBB | Contributors