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.
How to select only created sketch objects?
EFish
Member Posts: 16 EDU
I've been working on improving the part lightening script that I made, and have run into a issue that I can't think of a way to get past. I have the script create rectangles follow the path of selected lines to make the ribs between parts. But I'm running into the problem where the extrude operation includes automatically generated faces from enclosed regions.
Like so:

When I want the selection to be like so:


Does anybody know how to do this?
Thanks in advance






Like so:


Does anybody know how to do this?
Thanks in advance
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
-
One option is to make multiple sketches and extrude them all.
var toExtrude is array = [];<br>// sketch1, has one rectangle<br>toExtrude = toExtrude->append(qSketchRegion(id + sketch + 1)); ... opExtrude(... "entities" : qUnion(toExtrude) ...);
In Onshape, sketches really only have their 1d entities until skSolve is called, at which point all relevant regions are created (imprinted). So, without splitting into multiple sketches, the in-between regions are not easily distinguishable from the ones you want. If you modeled this without code you might rely on manually selecting the right regions instead of making many sketches, but with code we can just automate the sketches so that's easier!
0
Answers
-
Oops I forgot to add a link the document. Here it is:
https://cad.onshape.com/documents/028ca8fb10baf53e1f6fce96/w/b1250a450d0ba88f0a8b1811/e/ef08c3ab65c0c74bdd957fed?renderMode=0&uiState=61d895056356e07fd6176e97
FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com0 -
One option is to make multiple sketches and extrude them all.
var toExtrude is array = [];<br>// sketch1, has one rectangle<br>toExtrude = toExtrude->append(qSketchRegion(id + sketch + 1)); ... opExtrude(... "entities" : qUnion(toExtrude) ...);
In Onshape, sketches really only have their 1d entities until skSolve is called, at which point all relevant regions are created (imprinted). So, without splitting into multiple sketches, the in-between regions are not easily distinguishable from the ones you want. If you modeled this without code you might rely on manually selecting the right regions instead of making many sketches, but with code we can just automate the sketches so that's easier!
0 -
Ok, that would work for this case very well, I am a bit concerned about the effect on the performance this method may have. But I'll try it out to see how it does, thanks!FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com0 -
Performance is easy to check with the FS profiler: https://cad.onshape.com/FsDoc/debugging-in-feature-studios.html#profiling-regeneration-timings
As you're not making thousands of sketches I wouldn't think the performance should be hugely different!0 -
True, it works great! Thank you Kevin!FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com0

