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.

Create sketch at intersection of face with sketch plane

I have a solid and need to trace the cross section at various heights, matching the functionality of the Intersection feature in sketch mode.
I have a script to generate parallel planes intersecting the solid at various heights, but I can't find a way to replicate the Intersection functionality on each of these planes.
Here's a test Part https://cad.onshape.com/documents/465690599b6739cfa9025632/w/1324cb723889014e32d90d2b/e/8dd53f1e62b25f885f88f974
Does anyone have any ideas how I may solve this?

Comments

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,215
    You can use opSplitFace like this: https://cad.onshape.com/documents/3d93a9511178b81ff24933ee/w/e7ea12d246b978bdab5f2490/e/5e8642ea5268e07764c89705

    That may be different from what you want in that it actually splits the faces.  If you want to leave the body untouched, make a copy of it first (using opPattern), do the splits, use opExtractWires to make a copy of the new edges you want, and then use opDeleteBodies to remove the part copy.  Hope this helps.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • graham_lockgraham_lock Member Posts: 158 PRO

    I know this is an old post but could you show how to use opExtractWires in the example script please?

  • Caden_ArmstrongCaden_Armstrong Member Posts: 188 PRO

    Its very straight forward. It only takes in a query containing edge entities. It generates wirebodies with those edges. If the edges are not connected, it creates separate bodies, and joined edges create a single body.

        
    opExtractWires(context, id + "opExtractWires1", {
                "edges" : definition.edges
    });
    

    example
    https://cad.onshape.com/documents/74602c6e3b7235e71375f012/w/9a574195a44b60e84a90c1ca/e/205e50e64ae378e1733e5d46

    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
Sign In or Register to comment.