Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

FeatureScript and Assemblies?

mbattistellombattistello Member, Developers Posts: 51 ✭✭
Im trying to use FeatureScript to replicate an automated process I have built in Proe using trail file. Id like move the core build process from Proe into OnShape.  The Proe trail is building a PCB from an intermediate text file (IDF) that describes the board outline, slots, and holes and also includes the components and placements. The build process includes generating the board, basic sketch that is extruded, and then pulling in component modules based on the components and placements.

Im able to generate the board using FeatureScript but stuck on how to handle building the assembly. FeatureScript seems to be limited to building parts in the parts studio. I dont even see an option to view code in an assembly tab.

I have done some work where I import the STEP file exported out of Proe and I can see that OnShape brings the full assembly STEP file into a parts studio. It does this using an importForeign() with reference to the imported STEP file. I am wondering if the solution is to do something like this? I would build the board using FeatureScript and then import the individual components and place them using the importForeign() function?


  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    edited June 2016
    Yes, you're correct that FeatureScript is not usable in assemblies, and assemblies themselves are not written in FeatureScript like Part Studios are.

    You're also correct that you can still work with multiple parts within a Part Studio. If those components are defined in other Part Studios, you can use some of the importing workflows defined here, which function similarly to "derive part".

    One day, we hope to be able to add behaviors where FeatureScript can specify attributes on geometry that tell an assembly what it's intended to be mated to (e.g. What kind of components can/should go in a certain hole or set of holes). This would be useful in standard Onshape features and custom features alike.

    For now, keeping all the automation in FeatureScript inside of one Part Studio looks like the best path forward for you.

  • dave_cdave_c Onshape Employees Posts: 42
    In addition to what Kevin says, since things don't move on a PCB, you can make the assembly from the part studio in one step and group all the components so they can't move relative to one and other (you do not need to mate them individually).  Then you can re-use that assembly in multiple other assemblies.
  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,136 PRO
    edited June 2016
    @dave_c @kevin_o_toole_1 if the PCB in the part studio has multiple components that are the same (instances), when inserted into the assembly you will not get a part count as these come in as individuals not instances. Is there a way in the Part Studio to instance parts to enable BOM counts after transferring to assemblies?
    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • lougallolougallo Member, Moderator, Onshape Employees, Developers Posts: 2,000
    @mbattistello Currently FeatureScript, as you already know, is a Feature-based scripting language so it is really designed about creating features not assemblies, however much of the automation you wish to do would be accessible via our API once we launch it.  It would then allow you to access not only the features and the building of FeatureScript but the ability to use some of our Assembly endpoint to build your assemblies.  
    Although our API is not yet public, once live you will have be ability to patch together much more powerful, full workflow solutions.  FeatureScript will be a link of the chain.  You can get a sense of this power with the number of things being done by our partners today.  ~Lou
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
Sign In or Register to comment.