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.
Convert column in imported CSV to a user selectable list
shawn_crocker
Member, OS Professional Posts: 865 PRO
Title says it all. Just can't figure out how this is done. CUSTOM SHEET METAL FEATURES | sheetMetalStart.fs Copy 1 (onshape.com)
Thanks so much if you can provide an example or point to one.
Thanks so much if you can provide an example or point to one.
Tagged:
0
Best Answers
-
NeilCooke Moderator, Onshape Employees Posts: 5,671Sorry to lead you astray there @Alex_Kempen but all user interface components must be static so nothing can be done on the fly.What I was referring to was some sort of external parsing code that could convert csv into a map suitable for a LookUpTable. You would then have to copy/paste the resulting text into a separate Feature Studio and reference that in your feature. So if the csv changes you would have to update your feature each time.Senior Director, Technical Services, EMEAI0
-
shawn_crocker Member, OS Professional Posts: 865 PRONeilCooke said:Sorry to lead you astray there @Alex_Kempen but all user interface components must be static so nothing can be done on the fly.What I was referring to was some sort of external parsing code that could convert csv into a map suitable for a LookUpTable. You would then have to copy/paste the resulting text into a separate Feature Studio and reference that in your feature. So if the csv changes you would have to update your feature each time.0
-
NeilCooke Moderator, Onshape Employees Posts: 5,671yeah the second one unfortunately.Senior Director, Technical Services, EMEAI0
Answers
Thanks. I will have to do some experimenting with reusing existing code and just creating a new interface. For the time being, I have just created an enum that matches the values in the csv. It works OK for me but my secondary goal is to have a feature that other people can use without having to dig into the code to use.
2.5 years later and I am finally revisiting this. . Are you able to clarify how a .csv can be used to populate a lookup table? I have been messing around a bit and it feels like featurescript really wants me to define the const explicitly. I have tried sneaking in a function to create a const that includes a loop to format the cvs data in the way the lookup needs it to be structure. Featurescript still seems to be able to tell I'm trying to pull a fast one on it.
The error looks like this:
Any guidance on this would be great. Being able to reference a csv to drive a list of options would greatly streamline some features I have cobbled together.