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.
Query for X-Axis of a Plane
john_hauck
Member Posts: 52 PRO
How do you create a query for the x-axis of a plane.
For example, create a linearPattern, where the directionOne is the x-axis of "plane".
Here is an example of my goal (search for "HELP").
https://cad.onshape.com/documents/58de8571e7f5970f9b69196e/w/cb98dc68021732fbe1ee1c1f/e/918f9249b142236fd610d08f
For example, create a linearPattern, where the directionOne is the x-axis of "plane".
Here is an example of my goal (search for "HELP").
https://cad.onshape.com/documents/58de8571e7f5970f9b69196e/w/cb98dc68021732fbe1ee1c1f/e/918f9249b142236fd610d08f
Tagged:
0
Best Answer
-
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565My mistake, I misread your script. You'll want the first argument to those functions to be id + "sketch"
FeatureScript has two different kinds of "id" - operation ids use the Id type and are hierarchical arrays. Sketch ids are just plain strings. sketchEntityQuery wants one of each: the operation id of the sketch (id + "sketch") and the sketch id of a specific entity within the sketch (given by the skRectangle function... which just concatenates strings to make edges of "tile.left" etc.).
Your confusion here is, frankly, pretty valid. We'll make a priority of documenting various sketch functions to explain this behavior better.2
Answers
For identifying the different sketch regions, unfortunately the only option is to use something like qContainsPoint to disambiguate the regions. The regions that result from a sketch solve are not directly associated with the edges you create when sketching (for instance, a sketch with two rectangles and a line can produce up to six regions, each touching edges from all three operations). So if you put those operations in the same sketch, you need something like a point in space to specify the exact region you want.
Alternatively, you could distinguish the regions by simply putting the two rectangles in different sketches. Performance-wise, I suspect a single sketch would be faster, but only the profiler can say for sure.
https://cad.onshape.com/documents/58de8571e7f5970f9b69196e/w/cb98dc68021732fbe1ee1c1f/e/a978e9aefeb5da28a9d39ab9
Is it because of the way I defined the Id for skRectangle: "tile" vs id + "tile"? (line 43)
Is it because there is an extrude with an Id of id + "tile"? (line 55)
I think I ruled out those possibilities, so I'm sorry but I might need another hint.
FeatureScript has two different kinds of "id" - operation ids use the Id type and are hierarchical arrays. Sketch ids are just plain strings. sketchEntityQuery wants one of each: the operation id of the sketch (id + "sketch") and the sketch id of a specific entity within the sketch (given by the skRectangle function... which just concatenates strings to make edges of "tile.left" etc.).
Your confusion here is, frankly, pretty valid. We'll make a priority of documenting various sketch functions to explain this behavior better.