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.

Trying to query for edge betwen a loft and an extrude

In featurescape I am trying to add a fillet on an edge between a rocket in and body (loft and extrude).

I've manually put in in the fillet, but I would like to do it in featurescript ("TODO" in the feature script).

I need form a query to find the edge. I've tried a bunch of things, but no avail.  Something like ...

 var filletedge = qNthElement(qEdgeAdjacent(   qCreatedBy(id + "loft1", EntityType.FACE) , EntityType.EDGE),0);






Best Answer

  • lanalana Posts: 453
    Accepted Answer
    @curtis_heisey
    I'd recommend using opFillet for better performance. 
    The edge highlighted by
     debug(context, filletedge);
    is the bottom edge of loft. You want to fillet the edge created by Boolean merge post-operation in circularPattern.
    Please see how I handled it here.

Answers

  • MBartlett21MBartlett21 Member Posts: 1,535 EDU
    MB - I make FeatureScripts: view FS (My FS's have "Official" beside them)
  • curtis_heiseycurtis_heisey Member Posts: 2
    edited December 2018
    So I can now pick out the edge via featurescript   debug(context, qNthElement(qCreatedBy(id + "loft1", EntityType.EDGE), 0));

    When I try to do a loft via featurescript, I get an error (I picked this snipped out from doing the feature manually then looking at the code):
         var filletedge = qNthElement(qCreatedBy(id + "loft1", EntityType.EDGE), 0);
          debug(context, filletedge);


            var fillet_radius = 0.2*inch;          
            var rho=0.5;
            var magnitude = 0.5;
            opFillet(context, id + "fillet_1", { "entities" : filletedge  ,
            "tangentPropagation" : true,
            "crossSection" : FilletCrossSection.CIRCULAR,
            "radius" : fillet_radius,
            "rho" : rho,
            "magnitude" :  magnitude,
            "defaultsChanged" : false,
            "isVariable" : false,
            "vertexSettings" : [],
            "smoothTransition" : false });


    @opFillet: FILLET_FAILED

    267:12   
    onshape/std/geomOperations.fs (opFillet)


    258:9   
    Rocket Fin Can generator (const FC_Generator)

    54:17   
    onshape/std/feature.fs (defineFeature)

       
    Test FC

       
    Test FC

  • lanalana Onshape Employees Posts: 453
    Accepted Answer
    @curtis_heisey
    I'd recommend using opFillet for better performance. 
    The edge highlighted by
     debug(context, filletedge);
    is the bottom edge of loft. You want to fillet the edge created by Boolean merge post-operation in circularPattern.
    Please see how I handled it here.

Sign In or Register to comment.