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.
Extrude Function Having Strange Behavior
EFish
Member Posts: 16 EDU
Hi, while working on a shaft FeatureScript, some interesting behavior came up when using the extrude function (I do wish I could use the hole function). Where in certain inputs the extrude to apply the values work, but other times it doesn't. Some help would be greatly appreciated.
Document link:
TMM Featurescripts
Document link:
TMM Featurescripts
FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Tagged:
0
Best Answer
-
Alex_Kempen Member Posts: 248 EDUI see you're building a shaft generator for FRC. It might not be a bad idea to take a look at Julia's Shaft FeatureScript, which can be found here.
Since you've been pretty vague with everything, I'll stick to giving you some general advice about troubleshooting your own problems. I would start looking for problems by adding some relevant print and debug statements before any extrudes which you think are acting up. For example:// Print some stuff! println("roundExtrude"); debug(context, qSketchRegion(id + "startSketch"));<br>println(length); extrude(context, id + "roundExtrude", { "entities" : qSketchRegion(id + "startSketch"), "endBound" : BoundingType.BLIND, "depth" : length });
Generic print statements (like println("roundExtrude")) can also be used to quickly check what sections of code are running. If you see one thing printed in the console when you're expecting something else, then you've found your issue.
P.S. You should consider using opExtrude and opBoolean instead of the Onshape extrude feature. They'll perform better and be easier to understand. They're also documented better.CS Student at UT DallasAlex.Kempen@utdallas.eduCheck out my FeatureScripts here:0
Answers
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Since you've been pretty vague with everything, I'll stick to giving you some general advice about troubleshooting your own problems. I would start looking for problems by adding some relevant print and debug statements before any extrudes which you think are acting up. For example:
Generic print statements (like println("roundExtrude")) can also be used to quickly check what sections of code are running. If you see one thing printed in the console when you're expecting something else, then you've found your issue.
P.S. You should consider using opExtrude and opBoolean instead of the Onshape extrude feature. They'll perform better and be easier to understand. They're also documented better.
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com