When is an assembly not an assembly? When it’s a weldment!
I know, that “joke” might not get me a job in standup comedy, but weldments are funny things. They’re not a part and they’re not an assembly; they’re an assembly of parts treated like a single part. So what is the best way to model them: As an assembly or as a part? Fortunately, Onshape has multi-part Part Studios, so you get the best of both worlds. Now all you need is a weldment feature. Fortunately, we have FeatureScript.
FeatureScript is the same programming language that our developers use to create all of Onshape’s built-in features. By sharing it with the public, Onshape has given every user the power to build their own native CAD features. Unlike macros, all the feature logic can be built in – and custom features react to changes in model topology, just like native features.
Using this programming language, I recently created the Beam feature to be enjoyed by the entire Onshape community. But the best thing about FeatureScript is that you don’t have to be a programmer to enjoy the benefits! There are numerous custom features available for free on Onshape’s FeatureScript Spotlight page.
Let’s take a look at the Beam feature:
In the video in this blog, I create a fairly simple weldment using FeatureScript. You could, of course, build this weldment using the standard feature tools. However, if you take into account all the sketches, extrudes, and trimming operations required for each beam, you would need 20 to 30 features compared to one – and spend 10 times as long working on them. That’s the power of FeatureScript!
Adding Beams to Your Feature Toolset
To use the Beam feature, click the “Add custom features” icon on the far right of the Part Studio toolbar.
In the “Add custom features” dialog, select the “FeatureScript samples” filter, then “FeatureScript Beams” from the list and then choose the Beam feature.
This will add the Beam feature icon to your toolbar and you will see it in every Document. You can then follow the tutorial in the video to create weldments whenever you need them.
How to Create Custom Profiles
The supplied Beam feature comes with a limited set of profiles. More will be added over time, but if you need to add your own specific profiles now, then use the Beam Profile Generator feature (pictured above). The source code for the Beam feature has been publicly released, so you can make your own personal copy and add your own custom profiles.
To create a custom profile, first create a sketch on the Top plane in a Part Studio, then either sketch a profile or import a profile. (Note: The sketch origin is the initial location point of the profile when a Beam feature is created, so you can use the sketch Transform tool to move your profile if required).
Exit the sketch, then create a Beam Profile Generator feature and select one of the outer sketch entities. In the FeatureScript notices pane (the checkmark inside curly braces icon), you will find the code that must be copied and pasted into the Beam Profiles tab of your copy of the Beam feature. It’s not as difficult as it sounds. The steps required are detailed in this webinar.
This custom feature is fairly complete, but there are a few things that I still need to add, such as cut lists and weld gaps. In the meantime, please give it a try and let me know what you think by posting your comments in the Onshape Forums.
If you’re new to FeatureScript, don’t forget to check out the other time-saving features you can use right now on Onshape’s FeatureScript Spotlight page.