Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Loops in Precondition
Lauren_Froschauer
Member Posts: 10 EDU
Emily and I are trying to implement a variable amount of inputs in the precondition.
We are trying to generate N amount of input boxes in the feature dialog that is based on the number N entered by the user in another dialog box.
We have tried a for loop, and discovered that this is not possible. We get the error " nonconforming precondition: unexpected statement type (loop).
Is there a way to have N boxes generated? Or a way for a user to input an array of values into one dialog box?
We are trying to generate N amount of input boxes in the feature dialog that is based on the number N entered by the user in another dialog box.
We have tried a for loop, and discovered that this is not possible. We get the error " nonconforming precondition: unexpected statement type (loop).
Is there a way to have N boxes generated? Or a way for a user to input an array of values into one dialog box?
0
Comments
If you are writing a feature, you could try using the 'editing logic function', though, in which you can do arbitrary logic. You do that like this:
Your function needs to be declared like this:
It will be called whenever your feature inputs are edited, and there you can pretty much do whatever.
I used this approach as a work-around when I was needing to dynamically manipulate the inputs.
HTH
Thanks in advance,
Darren