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.
Linear Pattern an Extruded Cut in FeatureScript
william_friet
Posts: 4 ✭
Hello,
I'm trying to wrap my head around FeatureScript but can't figure out what to do with linearPattern and an extruded cut. In the end I'm trying to get a rectangular grid of cuts. Essentially what I am trying to do is:
1) Create a solid rectangle
2) Create a rectangular hole in the corner of that rectangle
3) Pattern that hole across the original rectangle using linearPattern
If there is a better way of doing this or if you know how to do it please let me know
Thank you
I'm trying to wrap my head around FeatureScript but can't figure out what to do with linearPattern and an extruded cut. In the end I'm trying to get a rectangular grid of cuts. Essentially what I am trying to do is:
1) Create a solid rectangle
2) Create a rectangular hole in the corner of that rectangle
3) Pattern that hole across the original rectangle using linearPattern
If there is a better way of doing this or if you know how to do it please let me know
Thank you
0
Comments
-
I would take the following steps to accomplish this:
1) Create a sketch of your rectangle. Extrude the sketch profile into a solid body.
2) Create a new sketch of the rectangular hole profile you intend to cut into your body. Extrude this rectangular hole profile into a new body (call it the 'cut tool').
3) Apply your linear pattern to the cut tool to produce an array of cut tools. Then use boolean subtraction to produce the cuts in your original solid body.
Do you need code to illustrate any or all of these steps? Can provide, just not sure what you are asking for.0 -
@william_friet
make sure you use Linear Pattern Plus by @Evan_Reese
make sure you have the latest version of linear pattern plus
And when you pattern, you want to pattern the 4 faces of the square hole. Of the options that you can pattern, patterning a FACE Is the least compute-intensive to do
https://cad.onshape.com/documents/70e7882d9bcffd2c56b7dfef/w/9a205b5dd1cb851c7b1015e5/e/65bf5609e703065f17c5d9ef
0 -
@william_friet
after thinking about it, I modified the documentThere are certainly times when it is best practice to have one sketch for the basic part and another sketch for the hole and then separate extrudes for each sketch
But in this case, since I just wanted to make a simple grate, there was no need for multiple sketches and no need for multiple extrudes, being as I was patterning the faces of the hole
Some might say it’s best to be consistent in the way that you go about your modeling. But I’m a hobbyist. What I do I do for myself. So that’s something to keep in mind0 -
@william_friet
Are you wanting to do this in a custom feature you're working on, or just get it done in a model?0 -
@Evan_Reese
Perhaps I should have been more specific, I'm trying to do this in a custom feature. While I understand the process to do this in the CAD interface using FeatureScript has given me difficulty. I've gotten linearPattern to work with extruding bodies but haven't with cutting bodies0 -
Got it. I have no idea your comfort level with programming and FeatureScript, so I'll keep it high level, and you can ask for clarity where needed. Without trying it myself, I'd try these steps:
- make a cuboid where the first hole should be where I need the hole (if you'll ever need a shape other than square, then maybe create a sketch object to extrude instead)
- boolean subtract the cylinder from the merge scope
- query the faces of the hole
- generate an array of transforms that define the locations of the patterned holes from the center of the hole
- generate an array of unique instance names for each new hole
- opPattern to actually pattern them
2 -
I didn't realize it was possible to form extrudes and cuts by patterning the faces - will certainly need to apply this in my performance bottlenecks. Thanks!0

