Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
How to use Move boundary in FeatureScript - opMoveBoundary()
MichaelPascoe
Member Posts: 2,018 PRO
I was having trouble finding how to use the Move boundary within FeatureScript. There is no OpMoveBoundary or OpExtend like you would expect. Here is how you can do it:
Import the extend FS from Onshapes STD at the start of your project.
Next, define the definition for the extend surface and call the function:
Import the extend FS from Onshapes STD at the start of your project.
// For move boundary import(path : "12312312345abcabcabcdeff/6509fdce3abecacec8f38b8a/cffdc47ca3931d4c4d41ee51", version : "0e66a19d0a986e71c5d22df8");
Next, define the definition for the extend surface and call the function:
// Extend ends using move boundary const extendSurfaceDefinitionLeft = { "entities" : leftEnd, // Query "tangentPropagation" : false, // Boolean "endCondition" : ExtendBoundingType.BLIND, // ExtendBoundingType "extendDistance" : definition.extensionLeft, // Length "oppositeDirection" : false, // Boolean "targetPart" : qNothing(), // Query "targetFace" : qNothing(), // Query "targetVertex" : qNothing(), // Query "maintainCurvature" : false // Boolean }; extendSurface(context, id + "leftEndExtend", extendSurfaceDefinitionLeft);
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
3
Comments
Thanks @Jacob_Corder!
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
And of-coarse if you're trimming edges back you'll need to use "opEdgeChange" you'll have to figure out how to use it by studying the "Extend" tab in std library source: https://cad.onshape.com/documents/02e253006c3b752eb13303a7/w/7b120b69b752b11fdbbb09dc/e/4b13fb3967e27f942c8ae475
Actually I'll go one better: I've made an opTrimEdges function in case anyone wants to trim back the boundaries of a sheet/surface:
Two more things to note that I've learnt is: