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

Query for specific SheetMetalDefinitionEntityType

MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
I would like to filter my edges (from qEverything) to be of a certain SheetMetalDefinitionEntityType, so i can pass them into sheetMetalCornerBreak without it erroring out.
Is there any way to do this?
mb - draftsman - also FS author: View FeatureScripts
IR for AS/NZS 1100
Tagged:

Best Answers

  • Options
    lanalana Onshape Employees Posts: 693
    Answer ✓
    We don't have a query filter for this. I'd go a different rout. 

    1. getSMDefinitionEntities(context, qEverything(EntityType.BODY), EntityType.BODY) would give you all the definition bodies.

    2. Collect their vertices

    3.  getSMCorrespondingInPart(context, qUnion(vertices), EntityType.EDGE)

    These edges can be sent to sheetMetalCornerBreak() 

    You still will be getting warnings for vertices next to bend edges, so it might be a good idea to filter out those in step 2.



  • Options
    MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    Answer ✓

Answers

  • Options
    lanalana Onshape Employees Posts: 693
    Answer ✓
    We don't have a query filter for this. I'd go a different rout. 

    1. getSMDefinitionEntities(context, qEverything(EntityType.BODY), EntityType.BODY) would give you all the definition bodies.

    2. Collect their vertices

    3.  getSMCorrespondingInPart(context, qUnion(vertices), EntityType.EDGE)

    These edges can be sent to sheetMetalCornerBreak() 

    You still will be getting warnings for vertices next to bend edges, so it might be a good idea to filter out those in step 2.



  • Options
    emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 859 ✭✭✭✭✭
    edited June 2018
    Maybe this example can help you

                annotation { "Name" : "Entities to fillet",
                            "Filter" : ((ActiveSheetMetal.NO && ((EntityType.EDGE && EdgeTopology.TWO_SIDED) || EntityType.FACE))
                                        || (EntityType.EDGE && SheetMetalDefinitionEntityType.VERTEX))
                                && ConstructionObject.NO && SketchObject.NO && ModifiableEntityOnly.YES,
                            "AdditionalBoxSelectFilter" : EntityType.EDGE }
                definition.entities is Query;
    Here is the full FS, so you can take a look to the complete code
    C2C - Full Round Fillet



    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • Options
    MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    Answer ✓
  • Options
    emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 859 ✭✭✭✭✭
    Ok, you already have my vote
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
Sign In or Register to comment.