Some Helpful Featurescripts

Would it be possible to make the “symmetric” option in extrude individual a checkbox instead of a dropdown? It would make it a bit more intuitive for new designers since the standard extrude uses a checkbox.

2 Likes

Hi All!
I have been working on a new FS for the past few weeks and I would like to see your opinion and help me find bugs (if there are).

The FeatureScript is “Spacer Standoff Pro”, it’s based on @dydx 's “Spacer” and “Shaft” FeatureScripts, but very different.
The feature is a little hard to understand at first but it’s very customizable
image

Instructions:
The default first view is:
image
Once you use the FS it will remember your last choice (in ALL parameters).
As you can see the “Bolt Spacer” and “Standoff” choices aren’t different than the “Spacer Standoff” (this feature is in the same document) FS that we used for the past year. Therefore, I will only explain about the new addition (1/2" Hex, 3/8" Hex, and CUSTOM).
If you change the shaft type to 1/2" Hex or 3/8" Hex it’ll be the same:
image
This is how the first default view will be. The first section is “normal” You need to choose an “origin” and the “End Face” or you can choose to do the extrusion “blind”.
The second part, “Change Defaults”, allows you to use standard spacers. If the checkbox is triggered then the FS will cut the spacer to multiple spacers. The FS will know which spacers’ lengths to use by typing the lengths in the “spacers”.
YOU NEED TO TYPE THE SPACERS’ LENGTH LIKE THIS:
spacer1 spacer2 spacer3

  • For example: 10 5 2
  • If the “Spacers” is blank then the FS will use 10 5 2 as the “spacers”
  • You can have a maximum of 6 different spacers (If your team needs more let me know, and I’ll add)
  • Make sure that between each length there is a space
  • Make sure to choose your units (Millimeters or Inches)

Now, you ask yourself, what does the feature do with this info?
The feature will find the closest “Standart Spacers” combination to match your desired length.
For example, if the desired length is 12mm and the standard spacers are 10mm,5mm, and 2mm then the FS will create two spacers; 1 10mm spacer and 1 2mm spacer

But what if there is no perfect match between the closest combination to your desired length? If that’s the case, the feature will add a “finishing spacer”. It will make the spacer the length you chose.

For example, if the desired length is 12.5mm and the standard spacers are 10mm,5mm, and 2mm then the FS will create two spacers; 1 10mm spacer and 1 2mm spacer, and a finishing spacer with the length of 0.5mm. When assembling the robot, you, of course, don’t put a 0.5mm spacer, you just put the 10mm and 2mm spacers. The point of the “finishing spacer” is to prevent assemblies from breaking. Here’s this example:
image

The feature makes a “composite part”, it makes all of the spacers and then connects all of them to a single “composite part”.

For ease of assembly and help visually, if you make a variable that’s named “RFP” (Ready For Production) then the “finishing spacer” will be shown in red.
image

The finishing spacer is displayed in red only when the RFP (Ready For Production) variable is defined because this helps prevent cluttering the Part Studio with multiple spacer parts during the design phase. By controlling the visibility of the finishing spacer, you can keep the Part Studio cleaner and focus on the primary components, only highlighting the finishing spacer when preparing the design for production.

Now let’s move on to the CUSTOM:
image
The “Standart Spacers” use is the same but the first section has changed.
First, you need to define whether you want to do a Hex or Spacer (round)
Then, you’ll need to define the inner diameter and the outer diameter of the CUSTOM Spacer/Hex. Lastly, you’ll need to define the material, Aluminium or ABS.

I want to give @AriMB credit for the amazing idea!

1 Like

Hi!
While I love this idea and think it’s very useful, I think FRCDesign.org’s configurable spacer stack may be a better option for most teams.

The main reason I think this is because the spacer stack is in the assembly, not the part studio. This allows the bill of materials to be accurate, and is faster for most workflows. It’s also a part inside of MKCad, so it’s very easy to use.

As you said, the generation of the spacers is in the assembly which means you need to define and update the length of the spacers each time you change something in the assembly.
The reason I have made this FS is to make it possible to generate the spacers In-Context. In addition, I believe that the MKCad version is limiting the use of spacers (I am an Alum of a metric team and all of the options in the MKCad version are Imperial), therefore I gave the option to define your team’s preferred “Standart Spacers”.

About your comment - BOM, I wish Onshape had an option for this but I haven’t found one; therefore I can understand. But, I believe that shouldn’t be a problem if a team that uses “Standart Spacers” will print a lot of the “Standart Spacers” they chose to use. FYI, the FS does put a line in the BOM, for example, “12 x 10 mm 1/2” Hex Spacer , 0 x 5 mm 1/2" Hex Spacer, and 0 x 2 mm 1/2" Hex Spacer". I am planning to make it easier to read and work with but it’s there!
If anyone has another question/comment, I would love to answer.

If you change something, do you not have to change your spacer lengths as well? This is about a 2 second fix, and Spacer Stack automatically calculates the spacers you need rather than having to type them in manually. However, as you’ve pointed out those are only imperial spacers available, and thus this is not as helpful for a metric team. (unless you print spacers but maybe you like metric everything to make it easier which is fair)

About your first comment, I believe that you need to define the length of the spacer and then the Spacer Stack will change. For example, we have two gearbox plates which already have a defined distance (because of gears, sprockets, etc.), you’ll need to select the 2 faces, copy the distance and then input it to the MKCad Spacer Stack length. If your gearbox changes, you’ll need to change all of the spacers’ length one by one. My solution gives you an option to do the generation In-Context, which means that when the assembly has changed, then the spacers’ lengths will change automatically.
Maybe I don’t know the MKCad Spacer Stack and I am completely wrong, but with what I can see, this is how the feature works. (Please let me know if I understood the generator incorrectly)
In addition, if I input to Spacer Stack a length which is not “a perfect match”, then the Spacer will be with an error and will do a rounded version of the spacer. Won’t it break assemblies?

For your second comment, you only need to enter your “Standart Spacers” ONCE. Once you entered your “Standart Spacers”, it will remember your choice forever. In other words, you need to “Change Defaults” only once.
If I haven’t answered your comment or you didn’t understand something about the FS, let me know!

Yes, I had it mixed up the first time. It is fixed now.

It will auto calculate to the nearest size spacer you designate in the configuration screen. It won’t break anything unless you mate directly based off of the spacers, which is not something I recommend. It shouldn’t break any assemblies.

EDIT: other question answered by reading comprehension, been a long day sorry :sweat_smile:

1 Like

You are correct and I too wouldn’t recommend “mate directly based off of the spacers”. In my opinion, it’ll just look a little weird that the wheel, for example, does’t “reach” the other side of the intake and that there will be an open shaft in the CAD (but I understand).

I believe that the feature should be used only in the “Up to Face” version. If you use Up to Face, then you’ll just need to update your In-Context. I’ll take your example, I have a 10mm gap between 2 plates, I realize I need it to be 15mm; If the gap between the faces has gone bigger then the length of the spacer will be bigger too automatically.
To clarify, the ONLY reason to go back to a “Spacer Standoff Pro” feature that has already been created is to change the origin and the end Face.

1 Like