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.
How do you write an app?
Lee_Hesketh
Member, Developers Posts: 148 ✭✭✭
Hello, I want to write a cut list app for onshape but I don't know how to do it. I have written a featurescript that queries all the parts and then gets the dimensions. I then want it to export that data to google sheets like the BOM app. How would I go about doing this? Are they written in featurescript or another language completely?
Thanks
Lee Hesketh
Thanks
Lee Hesketh
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
Tagged:
0
Best Answers
-
oleg_shilovitsky Member, Developers Posts: 131 PRO
@3dcad thank you for referencing!
@Lee_Hesketh openBoM is can extract geom dimensions of parts.
Take a look on this video
Current version of openBoM is only working with assemblies, but the next production update will bring a new feature to exctract BOM directly from Part Studio.
There is no calculations in openBoM cells for the moment, but we hope to deliver it next year. So, if you need to do heavy calculations, there is an easy export from openBOM to Excel spreadsheet to do rest of work meantime until we deliver it in openBoM.
@Lee_Hesketh - feel free to contact me directly - oleg @ openbom [dot] com.
5 -
awk Member, Onshape Employees, Developers Posts: 78As a 'general answer' to the 'how to write an app' - the starting place is https://dev-portal.onshape.com - this is a location to register your application with our servers and under the (?) icon in the navigation bar you can find a collection of general documentation on concepts and mechanisms use by apps (covering topics like authentication with OAuth, or working with the feature list and more).
There are also sample apps available to all at https://github.com/onshape-public and developers (who've signed in via the developer portal and agreed to the Onshape API Agreement) can also see the 'API Explorer' in the Onshape App Store which provides a way to test and explore the API (and provides per API documentation) in a live document.
Director of API, Appstore, and App Partner Technical Support5
Answers
@oleg_shilovitsky knows better
@3dcad thank you for referencing!
@Lee_Hesketh openBoM is can extract geom dimensions of parts.
Take a look on this video
Current version of openBoM is only working with assemblies, but the next production update will bring a new feature to exctract BOM directly from Part Studio.
There is no calculations in openBoM cells for the moment, but we hope to deliver it next year. So, if you need to do heavy calculations, there is an easy export from openBOM to Excel spreadsheet to do rest of work meantime until we deliver it in openBoM.
@Lee_Hesketh - feel free to contact me directly - oleg @ openbom [dot] com.
Twitter: @onshapetricks & @babart1977
The next update of openBoM will also extract image preview
Something like this...
The same update will also support generation of BOM from Part Studios.
Let me know if you have time - I'd love to have an opportunity to catch up and talk.
The OnShape APIs could enable most of this via a connected app. The one challenge is that right now the APIs are more focused on creation of content in OnShape and not as much on interrogating part dimensions. @oleg_shilovitsky also mentions this limitation when he talks about pulling dimensions from the bounding box only. This might work for simple, rectangular parts.
Another approach would be to embedded the dimensions driving the cutlist in the parts. Either as some custom attributes or in the part number/descriptions.
Ive been working with the API for a while and both approaches are possible if your ultimate goal is to do a more automated cutlist. Id be glad to collaborate with you on a demo app if you are interested.
I just gave obom a quick try, it seems to have the problem that I was curious when we talked about dimensions.
I have a tv stand, dimension xyz are correct for top, bottom and shelf but vertical panels have thickness in x etc..
And it also seems to show me meter as unit though I have millimeter set as default / in use with this document.
But this is great progress, going forward I will give it try when creating cutlist for production.
Cutlists have few other requirements too:
- Sometimes part dimension contain things like edgeband which thickness need to be reduced if pre-milling is not used to compensate
- Sometimes parts need to be cut bigger than actual model for routing / pre-milling
But these are special requirements and are considered usually only in specific software. All these could be covered with named dimensions that are accessible through bom..
ps. part images in bom looks great, looking forward to new versions
Thank you for the feedback. I have a stupid question - how we supposed to know that it is vertical panel and thickness is coming as X? Is there any information in Onshape that can help us to make this judgement?
I think, Onshape API only returns dimensions in meters for the moment, but I might be wrong and we will double check!
Thanks for sharing requirements for cutlists. This is probably for the future.
Images and BOM for Part Studio will be coming in the next version. Stay tuned.
There are also sample apps available to all at https://github.com/onshape-public and developers (who've signed in via the developer portal and agreed to the Onshape API Agreement) can also see the 'API Explorer' in the Onshape App Store which provides a way to test and explore the API (and provides per API documentation) in a live document.
thank you!
- Autologin to favorite apps when login to onshape
- Add quicklaunch so that favorite app is in same level with new part studio / assembly etc.
- Remove logos etc from apps and put them in as plain text or very small logo in footer or so
- Use similar icons and ui when applicaple to keep things familiar
In general I don't wan't to knowledge that I'm running external app inside Onshape when I'm working. Everything should look built-in. IMHO.
Yep, that is why I was interested in how is it generally possible to guess such thing. We tend to use X for the dimension along grain if panel has one and Z is always thickness of panel (this way optimization creates correct layouts for cutting).
I think only way to accomplish this would be that we need to be able to name certain dimension "X" and you call that into bom column X - this is not the name of variable since they are global for all parts in part studio but an additional 'tag' for dimension.
I would love to use these tags to reference other dimension like #(part1.X)+20
To be honest, I'm not satisfied at all with current variables.
Thanks for clarifications! It is easy to find the smallest dimension and assume this is Z. However, it might be geometrically incorrect with the Onshape coordinate system. I think, if you create each part independently and follow the same rule (Z is smallest dimension) it will be the case. However, my hunch is that because you create Parts in Part Studio (or multi-body part), as a result Z is not the thickness of the panel. Would you agree?
Yes, I create multipart studios and some parts have coordinate Z as thickness and some doesn't. But 99,9% of cases Z is the smallest dimension - now we are left with figuring between X and Y:
- If X = smallest --> X=Z and Z=X
- If Y = smallest --> Y=Z and Z=Y
So we just need to flip between smallest and Z if smallest isn't Z coordinate in first place. There are exceptions but this would cover most of cases (for me).
It won't be complicated to copy/paste values in current version of openBoM.
We have plans to support formulas in openBoM. I cannot confirm the date, but I will keep in mind your use case.