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.
holes to points in circular pattern
björn_britz
Posts: 14 EDU
i want to do holes. i created points in a circular pattern as the center for the holes.
no i have difficulties defining the locations and the scope in fs for the holes.
const anzahl = dimensions.Rotation;
for (var i = 0; i < anzahl; i += 1)
{
const t= rotationAround(rotationAxis, (2*PI* radian) * (i/anzahl) );
const point3d = t * patternPoint;
const point2d = vector(point3d[0],point3d[1]);
skPoint(PointSketch, "point" ~i, {
"position" : point2d
});
/* hole(context,"hole"~i, {
"style" : HoleStyle.SIMPLE,
"endStyle" : HoleEndStyle.BLIND,
"holeDiameter": 2*millimeter,
"holeDepth":3*millimeter,
"locations": XX,
"scope": XX
});
*/
}
for (var i = 0; i < anzahl; i += 1)
{
const t= rotationAround(rotationAxis, (2*PI* radian) * (i/anzahl) );
const point3d = t * patternPoint;
const point2d = vector(point3d[0],point3d[1]);
skPoint(PointSketch, "point" ~i, {
"position" : point2d
});
/* hole(context,"hole"~i, {
"style" : HoleStyle.SIMPLE,
"endStyle" : HoleEndStyle.BLIND,
"holeDiameter": 2*millimeter,
"holeDepth":3*millimeter,
"locations": XX,
"scope": XX
});
*/
}
heres the file: the problem starts in line 247
0
Comments
-
You need to solve the sketch before the hole feature, not after. For locations, try querying using qCreatedBy(id + "pointSketch", EntityType.VERTEX). For scope, you need to enter a query for the body/bodies you want the hole to go through.0
-
Oh right, thanks! I changed the solving thing.For locations, I tried your suggestion and for scope i tried qSketchRegion(id + "sketch") -- that's the sketch on which all the bodies, i want the holes to go through, are.It throws the error:throw INVALID_INPUT and throw HOLE_CUT_FAIL0
-
No, by body I mean a solid body. "Scope" is short for "boolean merge scope". The hole feature wants to know which solid body it should remove material from. So the query needs to look something like qCreatedBy(nameOfFeatureThatCreatedBody, EntityType.BODY && BodyType.SOLID).1
-
The syntax for what @mahir mentions is
qBodyType(qCreatedBy(<someId>, EntityType.BODY), BodyType.SOLID)
Jake Rosenfeld - Modeling Team0 -
Alright! Now I got it!Thanks a lot!0
-
Jake, I'm curious. Why is that preferred to "EntityType.BODY && BodyType.SOLID"? It's what the hole feature uses internally for it's scope query.Jake_Rosenfeld said:The syntax for what @mahir mentions isqBodyType(qCreatedBy(<someId>, EntityType.BODY), BodyType.SOLID)
0 -
@mahir
As described in the FS documentation:
Under the "Queries" section of https://cad.onshape.com/FsDoc/uispec.html
The `&&` operator in the body of a feature can only take booleans as its left and right hand side. "EntityType.BODY && BodyType.SOLID" would just be a syntax error because neither of those are booleans. The &&, ||, and ! operators are special cased for Query Parameter filters, but there is no special case within the code itself, and queries must be composed using the provided query functions.Jake Rosenfeld - Modeling Team0 -
@Jake_Rosenfeld, gotcha. Thanks. Short version = "cuz"
1


