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.

Table (New Custom Feature!)

MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO
edited December 2022 in FeatureScript

Table (New Custom Feature!)

https://cad.onshape.com/documents/01485b6de17aef414a25e778/w/926dfaef6b63d239b8d9d739/e/fb5da00aa581ddc9c53c4379?renderMode=0&rightPanel=cutlistPanel&uiState=6398b9684c6d6f30a465a5b1

Table 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!   cadsharp.com/featurescripts 💎

Comments

  • romeograhamromeograham Member Posts: 636 PRO
    Nice!
    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!
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO

    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!   cadsharp.com/featurescripts 💎
  • sebastian_glanznersebastian_glanzner Member, Developers Posts: 390 PRO
    @MichaelPascoe
    You created a composite part to display "Table data"!
    Is this the easter egg?
  • sebastian_glanznersebastian_glanzner Member, Developers Posts: 390 PRO
    Or that you allow "11" columns? B)
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO
    edited December 2022

    @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!   cadsharp.com/featurescripts 💎
  • romeograhamromeograham Member Posts: 636 PRO
    Fantastic @MichaelPascoe - love your responsiveness.

  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO
    edited December 2022

    Update!

    • NEW - Table name.
    • NEW - Custom tables panel now supports multiple tables.
    • NEW - Check box to simplify part for drawing. This reduces primitive count from over 3000 to 13.
    • Moved "Cut list" check box near the top of the UI.
    • "Cut list" composite part data is now named.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO
    edited January 9

    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!   cadsharp.com/featurescripts 💎
  • Chris_D_Mentes_001Chris_D_Mentes_001 Member, csevp Posts: 46 PRO
    Oh very nice! Thank you
  • jeff_brown304jeff_brown304 Member Posts: 20 ✭✭
    Oh that JSON export is cute!

    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.
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO

    @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!   cadsharp.com/featurescripts 💎
  • SethFSethF Member Posts: 127 PRO
    Looks like the expression driven approach overwrites the expression with a string? Which makes it so it doesn't update with changes to the variables used.
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO
    edited January 25

    @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!   cadsharp.com/featurescripts 💎
  • SethFSethF Member Posts: 127 PRO
    There we go. Before it seemed like it was overwriting whether or not I ever hit boolean again after setting the expression. But now it looks like it's maintaining those expressions as long as you don't switch it back and forth. Thanks!
  • Evan_ReeseEvan_Reese Member Posts: 2,034 PRO
    This is great incentive for us to add functionality like importing custom tables into drawings.  Because if we don't, our users do stuff like this  :)
     :D
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • jeff_brown304jeff_brown304 Member Posts: 20 ✭✭
    edited January 26

    @jeff_brown304, good info. And legit! let me know how it goes.


    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!
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO

    @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!   cadsharp.com/featurescripts 💎
  • javl0p_2javl0p_2 Member Posts: 37 ✭✭
    I've been looking for ways to automatize property asignation through FeatureScripts and I've always come to the same conclusion: i need a database that is native in OnShape so I can query its information. Could this Table FS be the solution I have been looking for? Could that be a reasonable use case?
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO
    edited February 24

    @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!   cadsharp.com/featurescripts 💎
  • javl0p_2javl0p_2 Member Posts: 37 ✭✭
    Ok, Variable Studios also seem like a fairly good choice, I'll check them out.

    Thanks!
  • Alex_PittAlex_Pitt Member Posts: 43 PRO
    This is fantastic! Great work @MichaelPascoe !
  • Kyle_BurtKyle_Burt Member Posts: 6 PRO
    @MichaelPascoe I've been heavily utilizing your FS (thank you!)

    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!
  • MichaelPascoeMichaelPascoe Member Posts: 1,552 PRO

    @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!   cadsharp.com/featurescripts 💎
Sign In or Register to comment.