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.

Options

@evDistance, what @ means ?

hervé_piponhervé_pipon Member Posts: 60 ✭✭
Hello

When I look at the evDistance function définition in evaluate.fs, there is a callback to @evDistance...
What does that means?
Is the source code available ?


export function evDistance(context is Context, arg is map) returns DistanceResult
{
    var result = @evDistance(context, arg);
...

Comments

  • Options
    MichaelPascoeMichaelPascoe Member Posts: 1,718 PRO
    edited December 2023

    @ functions are faster. If calling the function thousands of times, this can make a difference.

    See this comment from Jacob explaining more on evDistance vs @ evDistance
    https://forum.onshape.com/discussion/comment/88979/#Comment_88979


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Options
    _anton_anton Member, Onshape Employees Posts: 278
    edited December 2023
    Any identifier starting with '@' is a FeatureScript built-in. We don't expose the internals of these calls.

    We wrap our built-ins in FS functions in part because the results may need some massaging to be more nicely consumable. evDistance itself is a good example.

    (Michael is right, though - the function call overhead is nonzero, and you don't always need the wrapper.)
Sign In or Register to comment.