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.
"UIHint" : UIHint.COLLAPSE_ARRAY_ITEMS - Help returning the definition?
MichaelPascoe
Member Posts: 1,979 PRO
I'm trying to add a button that collapses the array items when needed. I'm still learning how to create functions and return definitions.
What is a good way to return the definition of: "UIHint" : UIHint.COLLAPSE_ARRAY_ITEMS
https://cad.onshape.com/documents/0fd0d47d9fced5bd2f4e9a65/w/bc8c5451b55eed1b1f21d5c8/e/fa063cc724c97cce5e5faac2
Thanks!
What is a good way to return the definition of: "UIHint" : UIHint.COLLAPSE_ARRAY_ITEMS
https://cad.onshape.com/documents/0fd0d47d9fced5bd2f4e9a65/w/bc8c5451b55eed1b1f21d5c8/e/fa063cc724c97cce5e5faac2
Thanks!
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
0
Best Answer
-
Alex_Kempen Member Posts: 248 EDUAs far as I'm aware, there isn't a way to collapse or expand arrays using editing logic, only fill in parameters inside them. You could do things like conditionally adding or removing array items (by adding on to the array), but I'm not sure whether that's useful for your application.
If you do want to use editing logic to work with arrays, I would recommend using my arrayParamterChange functions here to help determine when to run sub sections of your code and prevent errors during runtime.
If you're interested in learning more about functions, then you may benefit from reading through my intro to functions guide here. Editing logic essentially returns the definition but with some things rearranged (or not). The benefit of doing stuff in the editing logic (as opposed to, say, the feature body itself), is that the changed editing logic definition is filled into the feature's UI, allowing the user to make further changes as they see fit.CS Student at UT DallasAlex.Kempen@utdallas.eduCheck out my FeatureScripts here:2
Answers
If you do want to use editing logic to work with arrays, I would recommend using my arrayParamterChange functions here to help determine when to run sub sections of your code and prevent errors during runtime.
If you're interested in learning more about functions, then you may benefit from reading through my intro to functions guide here. Editing logic essentially returns the definition but with some things rearranged (or not). The benefit of doing stuff in the editing logic (as opposed to, say, the feature body itself), is that the changed editing logic definition is filled into the feature's UI, allowing the user to make further changes as they see fit.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴