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.
functions question
papawo
PRO
Best Answer
-
The body of your function does not use the 'context' variable, so there is no point to passing it in. I totally garbled the code block up there though, sorry. The call to the function should actually look like:
const getTRY = getInputFaces(definition.features);
Jake Rosenfeld - Modeling Team5
Answers
-
The highlight is unrelated. It's probably the highlight from selecting the face into the selection box. 'debug' entities are shown in red, not orange.
Your function isn't returning anything, which is why 'getTRY' also isn't anything. You'll need to actually return the Query:// I took out the 'context' parameter because it is not used. export function getInputFaces(features is FeatureList) { return qEntityFilter(qCreatedBy(features), EntityType.FACE); } // this should highlight your entities in RED and print something more useful to the console const getTRY = getInputFaces(definition.features); debug(context, getTRY);
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return
EDIT: fixed code block.Jake Rosenfeld - Modeling Team0 -
im getting this message:

why context is not use?
0 -
The body of your function does not use the 'context' variable, so there is no point to passing it in. I totally garbled the code block up there though, sorry. The call to the function should actually look like:
const getTRY = getInputFaces(definition.features);
Jake Rosenfeld - Modeling Team5 -
It works now.
I've learned something today.
Thanks again!
2

