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 a face created by opExtrude
ben_harkin
Member Posts: 8 EDU
I'm new to featurescript and I'm making a feature that creates standard metal extrusions. Which should look like this as a final product:
I want to query a face which is created from a sketch by opExtrude:
The sketch is built from 3 rectangles and 4 elliptical arcs which connect their ends:
I want to create rounded-corner square holes through the highlighted face. I was going to query the face to use as a sketch plane, then build the holes from 4 lines and 4 corner arcs, but I my attempts at making a query for this have failed.
I saw a potential solution on the forums using tracking queries and I tried something like this:
However, the debug always returns an empty array. I was going to try enabling trackPartialDependency for startTracking but there is no example for that form of startTracking so I was stumped.
My featurescript source is available here in the Simplified Metal Gen feature studio.
I want to query a face which is created from a sketch by opExtrude:
The sketch is built from 3 rectangles and 4 elliptical arcs which connect their ends:
I want to create rounded-corner square holes through the highlighted face. I was going to query the face to use as a sketch plane, then build the holes from 4 lines and 4 corner arcs, but I my attempts at making a query for this have failed.
I saw a potential solution on the forums using tracking queries and I tried something like this:
... skSolve(profileSketch); var fromTrackingLine = startTracking(context, id + "profileSketch", "faceTrackLine"); opExtrude(context, id + "baseExtrude", {...}); debug(context, evaluateQuery(context, fromTrackingLine), DebugCOlor.RED); ...faceTrackLine is a line I added on the sketch which should correspond to the face:
However, the debug always returns an empty array. I was going to try enabling trackPartialDependency for startTracking but there is no example for that form of startTracking so I was stumped.
My featurescript source is available here in the Simplified Metal Gen feature studio.
0
Comments
Could it be that you spelt DebugColor wrong?
This is the function which I'm calling to do this, note that some regions are commented out
The query is correct, but no highlighting.
I personally happen to have a few solutions for VEX C-channel which are both in active development and which I've employed in the past.
https://cad.onshape.com/documents/6a4c34c32c5e682a7255943c/w/b0d6114e5fd1de57c398df5f/e/729d68c86586f8f213b69b4b