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
Member, Developers Posts: 206 PRO
Best Answer
-
Jake_Rosenfeld
Moderator, Onshape Employees, Developers Posts: 1,646
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
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.
why context is not use?
const getTRY = getInputFaces(definition.features);I've learned something today.
Thanks again!