Open side-bar Menu
 MCADCafe Editorial
Jeff Rowe
Jeff Rowe
Jeffrey Rowe has over 40 years of experience in all aspects of industrial design, mechanical engineering, and manufacturing. On the publishing side, he has written over 1,000 articles for CAD, CAM, CAE, and other technical publications, as well as consulting in many capacities in the design … More »

Is FeatureScript One of Onshape’s Best Features?

 
August 4th, 2016 by Jeff Rowe

Almost all of today’s CAD products are pretty capable right out of the box, but I’ve often wanted them to do more to suit my particular needs and workflow. Over the years I’ve created macros and used Visual Basic and AutoLISP for defining, customizing, and automating functions and processes not found in CAD products out of the box. My results varied widely – some were good, some were OK, and some were downright unpredictable and bad.

Several years passed and I didn’t really do too much with CAD programming, so my interest waned. That all changed, though, when cloud-based Onshape’s FeatureScript came along earlier this summer.

FeatureScript is a programming language designed by Onshape for building and working with 3D parametric models. The language is built into Onshape and provides the foundation of Part Studio modeling, including geometric references, parametric tools, and a type system with types built for math in three dimensions.

The standard feature types in Onshape, such as Extrude, Fillet, and Helix are already written as FeatureScript functions. Using FeatureScript, custom feature types extend this same function mechanism to Onshape.

Is FeatureScript the first specific programming language to be released for a CAD product? No, not exactly, but it is unique in many ways and adds to Onshape’s positive differentiation in the crowded CAD marketplace.

Introducing Onshape’s FeatureScript

FeatureScript is associated with the Onshape Standard Library that provides all of Onshape’s features, such as Extrude and Fillet, as well as a large number of functions and types designed to work with geometry and help build custom features. All functions in the Standard Library are imported by default into all new Feature Studios (tabs containing FeatureScript).

I’ll admit, I don’t have a strong coding/programming background (or inherent talent) by any means, but have found FeatureScript relatively easy to learn and use.

All CAD systems have features, but no matter how many features there are in a CAD system, every user wants features that don’t exist. Either features that have slight differences from the ones that are there, or specialized ones that would never otherwise appear.

With FeatureScript, you can create your own built-in Onshape features – or modify existing ones using Onshape’s original source code.

By making FeatureScript public, Onshape provides a customizable parametric CAD feature set.

“This is the first time that a professional CAD system has made the implementation of its parametric features open and extensible,” says Ilya Baran, Onshape’s Director of FeatureScript. “In the past, the only way to change your feature toolbar would be to submit an enhancement request to your CAD vendor and wait forever. And most of those requests are never fulfilled. FeatureScript swings the pendulum back and puts you in control.”

“In traditional desktop-installed CAD systems, it is possible to write add-on or macro features, but they are never as good as the built-in ones,” he adds. “FeatureScript offers the first opportunity to create features that are first-class citizens – as much a part of the system as the ones the development team wrote themselves.”

Under the open source MIT License, Onshape is also sharing the FeatureScript source code for all of its own features, allowing customers to copy, modify or adapt them as they see fit. New Onshape features can now be created in Onshape’s new “Feature Studio,” a user-friendly development environment with an editor, in-line help, and documentation.

Creating A Custom Feature Using FeatureScript

A few possible uses for FeatureScript include:

  • Macro features (aka “user-defined features” in some CAD systems) are, as the name suggests, a way to add a custom feature to a CAD model. If you’ve gone this route, it’s presumably because you’ve already realized that the automation helps CAD productivity. FeatureScript can be used to define individual features, combinations of features, and entire parts. In traditional CAD systems, it’s possible to write add-on or macro features, but they never work as smoothly as the built-in ones. Features written in FeatureScript are as much a part of the system as the ones written by Onshape developers.
  • Designs with complex combinations of multiple features that have complex sequences of features that you have to create over and over again. With FeatureScript, you can speed up modeling time and repetitive tasks. One feature can replace multiple steps or monotonous tasks. For example, FeatureScript lets you combine multiple standard and/or custom features into one, such as a filleted pocket with draft.
  • Since FeatureScript is the same programming language that Onshape uses, you can use the API to customize design processes. Every Onshape feature (Extrude, Fillet, Shell, Loft, etc.) was created in FeatureScript, and Onshape shares the source code for all of its features for study and use.And to streamline your (or your programmer’s) development, FeatureScript comes with its own Integrated Development Environment (IDE) – an editor, inline help, and documentation.
  • If you use a rule-based system such as DriveWorks or Rulestream, you’re already familiar with the power of automating some design processes to create CAD models. These systems use rules and parameters logic to build valid models. It is an effective way to generate families of standard products. FeatureScript provides a way for building a specialized toolkit (for example, custom gears, enclosures, or connectors that are used repeatedly). FeatureScript can understand complex logic, so only valid parts will be created. Additionally, because FeatureScript runs in Onshape PartStudios, multiple components with one custom feature can be created.

“For 30 years, feature-based modeling has relied on a limited set of off-the-shelf features. With FeatureScript, we are ushering in a new era of custom parametrics,” says Onshape founder Jon Hirschtick. “Our early adopters have proven that with the ability to use custom features that they write or have others write for them, they’re able to significantly speed up their design process.”

“Customers who develop new features in FeatureScript are free to do with them as they please,” he adds. “Some may wish to sell them or share them with the community. Others might choose to keep their FeatureScript features proprietary as a competitive advantage.”

Onshape states on its website that FeatureScript not only helps a programmer like develop an appreciation for CAD, but helps CAD users develop an appreciation for programming. I couldn’t agree more.

Although Onshape’s new FeatureScript programming language does have its limits. For example, you cannot write code that interacts with external online parties (due to Onshape’s tight online security) or generate drawings. On a positive note, though, Onshape has introduced an open programming language that takes it’s cloud-based CAD service to a new level of customization.

Onshape didn’t exactly release FeatureScript with a lot of fanfare, but that’s the nature of the company – less hype and more reality. However, FeatureScript is one of the most significant features of Onshape and one of the many things that separate it from the competition.

Editor’s Note: As many of you know, I was a middle school math teacher (actually a Math Fellow) for Denver Public Schools (DPS) for the 2015-2016 school year. That’s behind me now, but I will remain involved with DPS going forward in more of a part-time fill-in role. However, since I am no longer a full-time teacher, to help fill my time I have volunteered to help run the IdeaLAB at Denver’s main public library – a free makerspace and digital media lab. It’s a new adventure for me, and like my teaching experience, I’m sure I’ll learn as much from those who come into the IdeaLAB as they learn from me.

Tags: , , , , , ,

Logged in as . Log out »




© 2024 Internet Business Systems, Inc.
670 Aberdeen Way, Milpitas, CA 95035
+1 (408) 882-6554 — Contact Us, or visit our other sites:
TechJobsCafe - Technical Jobs and Resumes EDACafe - Electronic Design Automation GISCafe - Geographical Information Services  MCADCafe - Mechanical Design and Engineering ShareCG - Share Computer Graphic (CG) Animation, 3D Art and 3D Models
  Privacy PolicyAdvertise