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.
Featurescript / app to generate SVG for CNC
loren_brichter
Member Posts: 5 ✭✭
Hi,
Sorry if this has been covered, I'm looking to create the OnShape equivalent to https://apps.autodesk.com/FUSION/en/Detail/Index?id=3662665235866169729 for Fusion 360. There's a use case to be able to export SVGs of a set of 2D faces for CNC machines (Shaper Origin, laser cutters, etc).
My rough idea is to have a FeatureScript feature to allow the user to select a set of faces to be exported / (or ideally automatically sync'd somewhere). Then create a companion app that when activated would find those FeatureScript feature and do the actual SVG conversion / download / sync (since it seems you can't do any of that from within FeatureScript itself).
I skimmed the FeatureScript docs and couldn't find a way to actually dig into the shape of a selected face, and on the app side only saw examples on how to pull in tesselated 3D models of the whole part, which isn't helpful in this particular case.
Am I barking up the wrong tree? I figured since there's already a dxf exporter, OnShape is probably 98% of the way there to being able to generate what I want, I'm just not sure how to finish wiring it up since I'm new to this side of things.
Any pointers would be appreciated.
Thanks!
Sorry if this has been covered, I'm looking to create the OnShape equivalent to https://apps.autodesk.com/FUSION/en/Detail/Index?id=3662665235866169729 for Fusion 360. There's a use case to be able to export SVGs of a set of 2D faces for CNC machines (Shaper Origin, laser cutters, etc).
My rough idea is to have a FeatureScript feature to allow the user to select a set of faces to be exported / (or ideally automatically sync'd somewhere). Then create a companion app that when activated would find those FeatureScript feature and do the actual SVG conversion / download / sync (since it seems you can't do any of that from within FeatureScript itself).
I skimmed the FeatureScript docs and couldn't find a way to actually dig into the shape of a selected face, and on the app side only saw examples on how to pull in tesselated 3D models of the whole part, which isn't helpful in this particular case.
Am I barking up the wrong tree? I figured since there's already a dxf exporter, OnShape is probably 98% of the way there to being able to generate what I want, I'm just not sure how to finish wiring it up since I'm new to this side of things.
Any pointers would be appreciated.
Thanks!
1
Comments
What you are looking for is to take the adjacent edges (qAdjacent with the face as the query, and looking at edge adjacent edge type entities).
evCurveDefinition will give you the specifics of each edge type, which you would then use to construct your svg.
As Neil said, you can't export with FeatureScript, but you can utilize the API to run featurescript code. The API also provides a method of detecting selections in a studio.
What you are trying to do is possible, I've done it for DXFs, which are very close to SVGs.
That same function is supported in the api via /documents/.../export, but it will export the entire part as a projection into the specified view plane.
@hovis
Its the client messaging system.
One of the things it can do is notify on user selection.
https://onshape-public.github.io/docs/clientmessaging/#capturing-selection-messages-from-the-onshape-client
My students and I use Onshape and Shaper. The workflow from Onshape to Shaper is messy and complicated for students. Anything to make the process smoother would be greatly appreciated here.
https://convertio.co/nl/dxf-svg/
but also - even if it is a bit tedious...it's not the end of the world and it's not an everyday thing:)