Dynamically updating the parameter array returned by getParameterDefinitions() ?
-
Is there a way to dynamically update the parameter window, so I could write a simple GUI that dynamically adds or removes parameters?
-
@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
-
@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 - firstly
-
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. -
@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.
-
@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.
-
@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.
-
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
-
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.