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.
Table (New Custom Feature!)
MichaelPascoe
Member Posts: 1,982 PRO
Table (New Custom Feature!)
https://cad.onshape.com/documents/01485b6de17aef414a25e778/w/926dfaef6b63d239b8d9d739/e/fb5da00aa581ddc9c53c4379?renderMode=0&rightPanel=cutlistPanel&uiState=6398b9684c6d6f30a465a5b1Table allows you to:
- Import CSV data
- Manually input data
- Store data as a custom table
- Store data as a Cutlist table so it can be inserted into a drawing
Special thanks to @NeilCooke for creating the native Cut list feature which allows this feature to get tables to drawings.
If you use Onshape for work, consider saving hours of work by automating your process with custom features and API.
CADSharp specializes in custom features and API.
How to add this custom feature to your toolbar?
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Tagged:
14
Comments
Michael - do you think we could use Variables or Custom properties in the tables, like so?
I guess you need to allow "use expression" in the Value field...something like that?
Thanks!
Great feedback @romeograham!
Currently it is set to string / text only. Expressions would be excellent to have, I'll include this in the next update.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
You created a composite part to display "Table data"!
Is this the easter egg?
@sebastian_glanzner You got it. Normal table features might only go to 10 columns.. This one goes to 11!
https://www.youtube.com/watch?v=4xgx4k83zzc
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Update!
- NEW - Expression based inputs. (Requested by @romeograham)
Note: The feature will attempt to convert your current value when you switch from Text to Expression or vise versa.Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Update!
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Update!
- NEW - Export to Excel (via JSON)
Simply right click the JSON to copy. Paste it into whichever conversion software you like (JSON to Excel).Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
I spent a little time experimenting with how to export significant amounts of data from a custom feature in a Parts Studio. Unfortunately, it looks like Custom Tables and the Variables Table truncate data for display in the UI after a few hundred characters or so and they also return truncated results when using the "Copy to Clipboard" action. So that's no good.
It looks like you're using a parameter in the feature editor. I played with that too and I managed to shove about 100 KB in there (which really surprised me!) but I suspect it'll cause stability issues if I push it too far. It's cute that it works but it doesn't seem scalable.
Unfortunately I can't embed newlines in a way that will survive copy-paste so for my purposes I'm going to try writing a custom app so I can have a more convenient download button and not risk overloading the UI. Creating a custom app has lots of other advantages although the barrier to entry is significantly higher.
@jeff_brown304, good info. And legit! let me know how it goes.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@SethF, Switch to expression first, then type the expression.
I have it set to try and convert the expression to string and vise versa. I'll take a closer look. Sounds like it isn't working how I intended.
There we go, see if that is better. It will not try to convert the string to expression, so there should be less confusion now. It will try to convert expression to string if you go the other way.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
So I’ve made a lot of progress on my CAM features and I’ve come up with two good solutions for getting substantial amounts of data out of Part Studios.
One solution was to simply use println() to dump the data to the Notices area from which the user can then copy-paste. I have a checkbox to do this in my G-Code post processor.
And the much more convenient solution was to store the data into variables in the context and write an app to get the data out.
So I did that. My G-Code post processor feature stores its generated files in variables along with a file index. My app’s user interface gets embedded into OnShape as a right side element panel for Part Studios and it provides links to download or view the files. Click a link, receive a file, it’s that simple!
Here’s the code for my app. It handles authentication with the OnShape API and presents the panel. If you had a whole ton of JSON or CSV or other data to export from a custom feature then something like this might do the trick!
(Or instead of writing an app, yet another alternative might be to write a shell script to download the data from the OnShape API using ‘curl’.)
Source: https://github.com/j9brown/camel
Aside: I’m planning to make a more formal announcement of my CAM features after I work out some more bugs and limitations and write some documentation. So let’s keep the conversation here focused on Michael’s cool new feature!
@jeff_brown304 wow, cool! Don't worry about my feature, it is a temporary plug while we wait for the real deal. But hey, have any GIFs? I would love to see this neat app and features in action.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@javl0p_2, this is more for viewing the data you already have in a custom table. However, what you are describing is possible. It will all depend on how automated you want your process to be and where you want to store your data.
A very manual workflow might look like this:
- Store all of your data in a google sheet.
- Copy and paste that sheet into a Variable studio.
- Now you can access that Variable studio from any Onshape document.
- Use custom features to assign those variables to the corresponding properties of your part.
There are entire systems for automating processes like this so that you save time and don't have to do any repetitive work by hand. Let me know if this is for your company and I can connect you with CADSharp.Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Thanks!
With Onshape's recent addition of the Tolerance column in an Inspection Table, I wanted to see if you think it's possible in your code to add the ability to exclude that column (or any other column) after a csv is read and before the cut list is created? I've been combing through your Feature Studio, but can't quite figure out how to make it work (figured it might involve skipping over a specific column number from the csv...)
Thanks again!
@Kyle_Burt Glad you like it!
So the ability to ignore a selected row or column from a csv?
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
- While keeping the input in (abc) mode, right click the input box > convert to expression.
- Place your variable within a toString() because the expression has to result in a string.
EDIT: After trying this some more, it appears that edit logic or arrays is breaking expressions. The try catch doesn't work either. I'll continue the search for a way to fix this.Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Update!
Thank you @Sam_Schlageck for providing feedback which triggered this update.There is currently a bug related to editing logic and arrays that breaks expressions.
To account for this, I have changed the opposite direction button to a check box which avoids using edit logic.
TLDR: With this update, variables will no longer break when adding new rows or clicking buttons.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴