Querying and extruding rectangles
jeff_day734
Member Posts: 9 ✭
FeatureScript noob here: I've spent hours trying to understand how to query and extrude faces on a sketch. I have a set of rectangles inside a larger rectangle, and I want to find and extrude the inner rectangles and outer rectangle to different heights. I have no problem getting the outer rectangle using this: var entities = qSketchRegion(id + "sketch", true);
But I can't figure out how to query the inner rectangles. Or, to be more precise, when I try to operate on what I believe is a valid query, I get empty array errors.
Here's the sketch in question. It's named "sketch1." Any tips on how to find and extrude all the faces?
0
Comments
-
You can use the filter inner loops to get the whole region and the outer area and subtract to get the inner area.
var outerRegion = qSketchRegion(id +"sketch1", true); // extrude this at one height
var wholeRegion = qSketchRegion(id +"sketch1", false); // used to help get the inner region
var innerRegion = qSubtraction(wholeRegion,outerRegion); // extrude this at the other heightwww.smartbenchsoftware.com --- Renaissance --- Kestrel -- SmartLink
Experts in Onshape Automation - Custom Features and Integrated Applications2 -
This worked. Thanks @Caden_Armstrong. Gives me a better sense on how to use and perform set operations on queries.
0

