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.
Updated custom feature: Fill pattern


By popular request, I have reworked Fill pattern to allow closer packing of instances and borders, plus better performance and error handling.
https://cad.onshape.com/documents/57361ad4e4b00e5012c3857c

Caution:
When updating existing models to this latest version, the improved border detection will modify the number of instances. Either increase the value of "border" until the number of instances match, or better still, don't update the feature. You can always use the Compare tool to check for differences.
https://cad.onshape.com/documents/57361ad4e4b00e5012c3857c

Caution:
When updating existing models to this latest version, the improved border detection will modify the number of instances. Either increase the value of "border" until the number of instances match, or better still, don't update the feature. You can always use the Compare tool to check for differences.
Senior Director, Technical Services, EMEA
13
Comments
Out of curiosity I was wondering what purpose this block of script is doing for error handling. I ran into a case where I had a hole pattern in a sheet metal part bounded by a sketch where edgesInFace was correctly evaluating before this snippet, but this bit of code turned edgesInFace into an empty query breaking the tool. Commenting this whole thing out fixes my case but I don't know if that opens me up to other bug cases.
if (isQueryEmpty(context, qSketchFilter(definition.target, SketchObject.NO)))
There are 3 prerequisites for the pattern to work:
That code is there to differentiate between the edges of the seed of the pattern and the edges of the target sketch face - otherwise any border offset would apply to the seed pattern edges as well and the result would be incorrect. The sketch used to bound the pattern must have imprinting enabled to create a face for the pattern and also create an imprint of the seed hole. If you have "disable imprinting" turned on then it won't work. This could be better with fewer prerequisites and better user feedback.
Ah that explains the issues we ran into with our original setup. We had imprinting disabled and the hole was generated after the sketch. Yeah that's a little unclear to the end user that there's an order of operations and imprinting requirement there. Interestingly by disabling imprinting and commenting out that block of code I am able to rearrange the hole to be generated before or after the sketch and it rebuilds identically between to the official version *provided you do have imprinting disabled*
Is there a featurescript way to query whether a sketch was generated with imprinting enabled or not?
To be honest, I probably never tested it with imprinting disabled (because at the time of first writing, it wasn't possible to disable imprinting). I guess the only way to test imprinting is the number of faces belonging to the sketch. I'll look into it.