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

opSweep multiple edges

tonvistonvis Member Posts: 41 ✭✭
Can somebody please help me out, I tryed everything to obtain a full path along a set of edges.

line 373
            /*  ----------------------  Why does this not generate multiple edges

               opSweep(context, id + "sweep4", {
               "profiles" : sketchEntityQuery(id + "sketch8", EntityType.EDGE, "flat"),
               "path" : qCreatedBy(id + "sketch7", qEverything(EntityType.EDGE))

               });
             */

Many thanks for any support.



Answers

  • Options
    Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Hi @tonvis

    First issue:
    qCreatedBy(id + "sketch7", qEverything(EntityType.EDGE))
    is not a valid query, I think what you are trying to say might be:
    qCreatedBy(id + "sketch7", EntityType.EDGE)

    but by adding the following line of code, I can see what that resolves too:
    debug(context, qCreatedBy(id + "sketch7", EntityType.EDGE));


    You will need to be more discerning in your query to only capture the edges you want to sweep over.

    This seems to get what you want:
                const path = qUnion([
                            qCreatedBy(id + "helix4", EntityType.EDGE),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc2"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset2")
                        ]);
    
                opSweep(context, id + "sweep4", {
                            "profiles" : sketchEntityQuery(id + "sketch8", EntityType.EDGE, "flat"),
                            "path" : path
                        });


    The "debug" call is very powerful to visually see what a query resolves to.  When I was working out the correct edges to select, I built up all the pieces of the qUnion in a call like this:
                debug(context, qUnion([
                            qCreatedBy(id + "helix4", EntityType.EDGE),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc2"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset2")
                        ]));
    Which showed this nice helpful red highlight:

    Then I knew the query was ready to be passed into opSweep!
    Jake Rosenfeld - Modeling Team
  • Options
    tonvistonvis Member Posts: 41 ✭✭
    Jake thanks for your help, I will give it a try.
    Featurescript is very nice , the scrips are very helpfull for anybody. The only problem  is  lack of examples. I study all I can find in publiced ones.
    Greetings  tonvis
Sign In or Register to comment.