Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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

papawopapawo Member, Developers Posts: 206 PRO
Tagged:

Best Answer

Answers

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    edited February 2018
    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 Team
  • papawopapawo Member, Developers Posts: 206 PRO
    im getting this message:


    why context is not use?

  • papawopapawo Member, Developers Posts: 206 PRO
    edited February 2018
    It works now. 
    I've learned something today. 
    Thanks again!

Sign In or Register to comment.