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

FeatureScript TableData not effective.

hervé_piponhervé_pipon Member Posts: 60 ✭✭
I write a FeatureScript which has to import a csv file :
export const CSV_Path = defineFeature(function (context is Context, id is Id, definition is map) precondition {
    annotation {
        "Name": "file"
    }
    definition.myPathCurve is TableData;

My problem is that half the time the file is not read

The script starts correctly,

If I click again definition.myPathCurve.csvData == undefined

And on the next click it works .... and so on...

How can I make it works all the time ?

Comments

  • Options
    Jacob_CorderJacob_Corder Member Posts: 126 PRO
    you are going to need to share an example.

    It is likely that you are not waiting enough time for it to load the data.  To test. just hit the green check box and wait a minute. if you go back in and reload it again and check box makes it work then its a bug.   I suspect your issue is due to not waiting for the loading wheel to be finished
  • Options
    hervé_piponhervé_pipon Member Posts: 60 ✭✭
    edited August 2023
    @Jacob_Corder
    I have both Part Studio View , and FeatureScript Notice View open at the same time.
    When I click  , I can read on FeatureScript Notice a message generated by my code that indicates that definition.myPathCurve.csvData == undefined

    if (definition.myPathCurve.csvData == undefined) { println("Undefined Path Curve !"); return; }

    There is no need to wait more...

  • Options
    hervé_piponhervé_pipon Member Posts: 60 ✭✭
    It's actually a handling error.
    To save time, I leave the selection window open between each test!
    So when I click the 2nd time, it simply deselects the file :/
    But as I'm only watching the FeatureScript Notice ViewI did not take care of this.
    Sorry for this wrong question  :s

Sign In or Register to comment.