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

Export sketch as piecewise polyline.

brad_phelanbrad_phelan Member Posts: 91 ✭✭

It's been a while since I've written any featurescript. I'm looking for the following solution. I would like to be able to select N closed and open chains of sketch entities and with a provided tolerance tesselate them into N piecewise polylines and then either print them to the console or copy them to the clipboard. Is this relatively simple?

Comments

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,875

    Would be easier to export as DXF with "export splines as polylines" option

    Senior Director, Technical Services, EMEA
  • brad_phelanbrad_phelan Member Posts: 91 ✭✭
    edited August 4

    Not really. I want a simple tool I can use to generate me polylines I can paste directly into a c++ program as test data. Using the OnShape sketcher and having a tool that can copy the sketch data to the clipboard as a

    std::vector<std::vector<Point2D» foo = { …… }

    is what I would like to have. It would probably exporting DXF and then processing that DXF with another tool to get what I want but it would be nice to have an all in one UI driven by featurescript that would do this for me. I can't imagine this useful to anyone else but me ;)

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 145 PRO

    You're not the only one who has a use for a tolerance based polyline script. When I did my Delaunay Triangulation script I settled for a basic global resolution subdivision script but there are times when I'll want more local curvature aware tolerancing for this and other scripts I'm working on. Export-import routines probably work for a lot of applications but it's definitely cleaner to keep everything at the feature level in my opinion.

Sign In or Register to comment.