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.
Variables and Equations based Parametric Modeling Vs. FeatureScript
A_Reed048
Member Posts: 6 EDU
Hello,
I've been using solid modeling software since 2003 (Inventor then SolidWorks) and for the sake of our FIRST team I am considering switching to Onshape so I'm giving it a try to see if I can translate my knowledge and experience from the last 21 years into this new system.
The part linked below is one of the more complex examples of a parametric part we often use in Solidworks. Saved as a part template anyone with access can generate a new file, modify a few global variables in the equation editor, click 'Ok' to solve and regenerate the part, and have a new herringbone gear for use in one of our mechanisms. I was able to use variables and very similar modeling techniques to generate more or less the same file in OnShape but when I attempt to edit one of the variables as I would in SW something in the solve order doesn't work out and it doesn't properly rebuild.
Is this functionality something I can achieve with Variables and Equations or will it require me to learn a whole new skill set of coding in FeatureScript? I know full well I could probably find a close enough match in the community's MKCAD library but for maximum flexibility, especially with such a short season, I want to know what I can and can't generate on my own skills.
I should note that I am terrible at coding and I would hope there is a way to achieve this with modeling practices that have been pretty standard in terrestrial CAD for quite a while. Otherwise, I have the feeling I'll have to put in a couple hundred hours over the summer on the FS support page learning how to piece together bits of code.
https://cad.onshape.com/documents/0063b1f0a3bc50bd69b9f661/w/4476560b317452c345397837/e/9f3493a17ea3fb64f7b5ca85?renderMode=0&uiState=66229d47f532d9514b37e610
I've been using solid modeling software since 2003 (Inventor then SolidWorks) and for the sake of our FIRST team I am considering switching to Onshape so I'm giving it a try to see if I can translate my knowledge and experience from the last 21 years into this new system.
The part linked below is one of the more complex examples of a parametric part we often use in Solidworks. Saved as a part template anyone with access can generate a new file, modify a few global variables in the equation editor, click 'Ok' to solve and regenerate the part, and have a new herringbone gear for use in one of our mechanisms. I was able to use variables and very similar modeling techniques to generate more or less the same file in OnShape but when I attempt to edit one of the variables as I would in SW something in the solve order doesn't work out and it doesn't properly rebuild.
Is this functionality something I can achieve with Variables and Equations or will it require me to learn a whole new skill set of coding in FeatureScript? I know full well I could probably find a close enough match in the community's MKCAD library but for maximum flexibility, especially with such a short season, I want to know what I can and can't generate on my own skills.
I should note that I am terrible at coding and I would hope there is a way to achieve this with modeling practices that have been pretty standard in terrestrial CAD for quite a while. Otherwise, I have the feeling I'll have to put in a couple hundred hours over the summer on the FS support page learning how to piece together bits of code.
https://cad.onshape.com/documents/0063b1f0a3bc50bd69b9f661/w/4476560b317452c345397837/e/9f3493a17ea3fb64f7b5ca85?renderMode=0&uiState=66229d47f532d9514b37e610
0
Best Answer
-
NeilCooke Moderator, Onshape Employees Posts: 5,726I dunno? Why not try it and see?Senior Director, Technical Services, EMEA0
Answers
https://cad.onshape.com/documents/5742c8cde4b06c68b362d748/w/b493e0cb681bbf9497d9f4b3/e/c72760543a0d4412e72f6d38
NeilCooke said:
I suppose it is somewhat a case by case basis but the last thing I want is a hard-stop stumbling block right in the middle of our very short season. Sorry, I'm probably overthinking a lot of this and need to just learn more about the software and become as flexible and agile with it as I am with SolidWorks.
Neil is right about configs; if you need multiple similar gears, you can make a Part Studio with a feature that generates a gear, and configure that feature's inputs. Then you can get multiple variants of the same gear to import into other tabs.
I am trying to compare it to my ability to create a part file in Solidworks, link a bunch of sketch dimensions and feature parameters to Global Variables and Equations and save it off as a part template to be used any time I need a gear, or cycloidal disc, or cam, etc. If done cleanly in Solidworks the software is able to figure out the solve order for the global variables and equations before rebuilding the part such that it generates a part with all of the changes and no errors. I tried to use the same techniques in the part file linked above and it appears to have stumbled on the order in which it regenerates the feature tree from the top down.
I'm going to guess the answer to my own question at this point that FeatureScript is going to be a more robust solution to generating "toolbox" or "template" parts that can be used from year to year between different projects. Equations at the top of the tree are probably better off for single use parts.
I guess I need to learn FeatureScript coding if I want to be as flexible with this as I am with Solidworks. Thanks.
Joking aside, another option would be to build just the equations in FeatureScript (so you have a full programming language to do whatever calcs you need, but they will have to be in order ), then model everything manually using those variables.
Aside from what is discussed above, one thing about your document that could certainly be problematic is that Sketch 3 is not fully constrained