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.

Is it possible to export numbers from a FeatureScript?

timo_schmidtimo_schmid Member Posts: 36 EDU
Hi everyone,
I'm trying to calculate a couple of values (e.g. distances) with a FeatureScript and then export them (to a type of file such as .csv, googleSheets, .txt)
Is this possible?
Any help is appreciated!
Cheers,
Timo

Best Answer

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,354
    Answer ✓
    No, you can only print to the FeatureScript console. You would have to copy and paste from there. 
    Senior Director, Technical Services, EMEAI

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,354
    Answer ✓
    No, you can only print to the FeatureScript console. You would have to copy and paste from there. 
    Senior Director, Technical Services, EMEAI
  • timo_schmidtimo_schmid Member Posts: 36 EDU
    Thanks for you answer @NeilCooke .
    Do you know if it would be possible to do such a task with the API instead?
    Cheers,
    Timo
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,354
    I'm not an API guy, but I imagine it may be

    Senior Director, Technical Services, EMEAI
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Using the Evaluate FeatureScript API, this his definitely possible.

    For more information, go to https://dev-portal.onshape.com/help, click "feature list API", and search "Feature Script Evaluation" or "Evaluate FeatureScript".

    You can do this one of two ways:
    1. Use a custom feature to call setVariable() to store the value. Then, use Evaluate FeatureScript API to call getVariable and get the value. This is the simpler route if you need a custom feature with user inputs in order to compute your value.

    2. Use Evaluate FeatureScript API with an FS function which does the entire FeatureScript computation. The is the simpler route if the computation is generic, since there's no need to insert any custom feature into your models

Sign In or Register to comment.