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.

Why are there 8 edges in a rectangle? and How can I select 4 that define the rectangle?

monroe_weber_shirkmonroe_weber_shirk Member Posts: 66 EDU
edited November 2021 in FeatureScript
I drew a rectangle in FeatureScript using skRectangle.
I solve the sketch and then debug the resulting sketch to see what is in it. 
It has 8 edges. Is this because it counts the edges going in both directions?
How can I write a query that just returns the 4 edges that define the rectangle?

The broader context is that I got quite confused about every line having two edges when defining a path for a sweep made of 8 lines. I ended up simply selecting the first half of the edges to define the path, but that doesn't seem like the right approach.


  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited November 2021
    When closed sketch region is created it actually adds to context sheet body on par with wire bodies. those sheet body owns faces, and those faces have their edges around. the interesting thing is that wire bodies edges and sheet bodies edges are treated as different edges which are not topologically connected. This why edge query of a closed region sketch resolved to a double number of edges than one could expect.
    So if you want to query face loop edges you need qCreatedBy(..., EntityType.FACE)->qLoopEdges()
    and if you want wire edges you need qCreatedBy(..., EntityType.BODY)->qBodyType(BodyType.WIRE)->qOwnedByBody(EntityType.EDGE)

  • monroe_weber_shirkmonroe_weber_shirk Member Posts: 66 EDU
    Thank you Konstantin. I learned a little more about how Onshape works!
Sign In or Register to comment.