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.

Options

Featurescript / app to generate SVG for CNC

loren_brichterloren_brichter Member Posts: 4 ✭✭
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!

Comments

  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,394
    The main issue here is that FeatureScript cannot export data, only create, modify or delete. So you would have to work out how to generate and create the profiles yourself then work out how to find the results with your app. 
    Senior Director, Technical Services, EMEAI
  • Options
    loren_brichterloren_brichter Member Posts: 4 ✭✭
    Makes sense, thanks. Is it possible in FeatureScript to dive down into the actual paths that make up an entity? Actually I'm re-reading the docs now and came across `evApproximateBSplineSurface` which actually looks like it might get me close to what I need.
  • Options
    caden_armstrongcaden_armstrong Member, User Group Leader Posts: 127 ✭✭✭
    BSpline surface isn't going to help you as you are trying to get the edges that define the shape of a planar surface.
    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.
  • Options
    loren_brichterloren_brichter Member Posts: 4 ✭✭
    @caden_armstrong thanks so much, this is super helpful!
  • Options
    hovishovis Member Posts: 7 ✭✭
    I have tried to make this app/featurescript before, and failed.  I'm specifically interested in exporting paths for the Shaper Origin, but I can see that there's continuing demand for a simpler SVG export to support different less-than-industrial CNC workflows.

    The API also provides a method of detecting selections in a studio.
    @caden_armstrong I don't suppose you could provide a link? I've looked for this but I can't find it. (The docs are great IF you know where to find the thing you're looking for).


  • Options
    caden_armstrongcaden_armstrong Member, User Group Leader Posts: 127 ✭✭✭
    If the part is already 2d, as a user you can right click on a face and export to dxf. Most CAM should be able to read dxf, even hobby grade softwares like lightburn support it. If you aren't looking for an automated way of doing it, thats an easy way to generate paths.
    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


  • Options
    quinn_renehanquinn_renehan Member Posts: 4 EDU
    I would be an eager adopter of this feature if it were available.
    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.

  • Options
    roman_jurt190roman_jurt190 Member Posts: 32 EDU
    same here! we have to use illustrator after exporting from onshape to shaper origin. something like the fusion360 plugin for shaper origin is what we need:) https://apps.autodesk.com/FUSION/en/Detail/Index?id=3662665235866169729
  • Options
    dirk_van_der_vaartdirk_van_der_vaart Member Posts: 541 ✭✭✭
    Or use this, an online converter.
    https://convertio.co/nl/dxf-svg/
  • Options
    roman_jurt190roman_jurt190 Member Posts: 32 EDU
    edited May 2023
    Or use this, an online converter.
    https://convertio.co/nl/dxf-svg/
    yes - but getting nice, connected shapes usually means manually join the paths in illustrator... also the fusion origin-plugin does a nice color-coding job... pockets gray, outlines black...

    but also - even if it is a bit tedious...it's not the end of the world and it's not an everyday thing:)
Sign In or Register to comment.