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.

Sweep along split line

graham_lockgraham_lock Member Posts: 196 PRO

Best Answer

  • graham_lockgraham_lock Member Posts: 196 PRO
    Answer ✓

    I edited the initial post and corrected a syntax error on the sweep.

    The code shown now works.

Answers

  • graham_lockgraham_lock Member Posts: 196 PRO
    edited March 23

    Hi,

    I'm trying to workout how to sweep along an edge created by a split in FS as can be done in the UI.

    The outline of my code is:

    // create plane at angle - THIS WORKS

    cPlane(context, id + "bodySplitter", {
    "entities" : qCreatedBy(id + config.longeronIndex + "skLine", EntityType.EDGE),
    "cplaneType" : CPlaneType.LINE_ANGLE,
    "offset" : 0 * millimeter,
    "angle" : planeAngle,
    "oppositeDirection" : false,
    "flipAlignment" : false,
    "flipNormal" : false
    });

    // split solid body with plane - THIS WORKS      
    
    opSplitPart(context, id + "splitPart1", {
            "targets" : config.solidBody,
            "tool" : qCreatedBy(id + "bodySplitter", EntityType.FACE)
    });
    
    // use sweep to create a body using previously sketched profiles -  - THIS NOW WORKS
    
     sweep(context, id + "sweep1",
            {
                    "bodyType" : ExtendedToolBodyType.SOLID,
                    "operationType" : NewBodyOperationType.NEW,
                    "profiles" : config.longeronProfiles[0].sketchRegion,
                    "path" : qNthElement(qCreatedBy(id + "splitPart1", EntityType.EDGE), 2),    
                    "profileControl" : ProfileControlMode.NONE    
                });
    

    The sweep throws an execution error.

    I have a test document here which shows what I'm trying to achieve using the UI:

    https://cad.onshape.com/documents/b47247537a19de65742c7ceb/w/a1f3a56d0c6bdd4de138c226/e/135b3120a9f5267d9588c24a

    Any help appreciated.

    Thank you.

  • graham_lockgraham_lock Member Posts: 196 PRO
    Answer ✓

    I edited the initial post and corrected a syntax error on the sweep.

    The code shown now works.

Sign In or Register to comment.