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.

BEST APPROACH AT GENERATING MULTIPLE DESIGN VARIATIONS BASED ON A VARIABLE-CONSTRAINED PART STUDIO

Hello,

I need some advice on how to approach the following idea.
Given a Part Studio and a single solid defined by a number of variables, I want to automatically generate variations of said solid and export them all as .STLs or .STEPs

In more detail...
  • Imagine a hollow cylinder defined by 3 variables (inner radius, outer radius, and depth) [Figure]
  • I need an app or FatureScript that generates variants of set cylinder by changing the values of the 3 variables
I am wondering what combination of API and FeatureScript functionalities are needed.
My current logic follows (high level):
  1. Create a variable-constrained solid in a Part Studio
  2. Create a FeatureScript that reads the variables of the part studio, creates a new solid with a variation of said variables
Problems here: Last time I checked, FeatureScript could not generate other Part Studios

My best guess to do this;
  1. Create a variable-constrained solid in a Part Studio
  2. Create an external app that: (1) duplicates the original Part Studio, (2) executes a FeatureScript that alters the variables of the solid within the Part Studio, and (3) Exports all of the Part Studios
Problems here: (1) Do not know if this is efficient, (2) This would require that the external app passes input parameters to the FeatureScript -- Is this possible now?

I look forward anyone's time, help and feedback!
Again, I am just looking for guidance on feasibility before getting my hands dirty.
Thank you,
 :# 

Figure --------------------- ;


Comments

  • mahirmahir Member, Developers Posts: 1,304 ✭✭✭✭✭
    I don't believe FeatureScript can be used to export files (i.e. .stp or .stl files). However, the API might be able to do this.

    That said, does this really need to be automated? How many permutations are you trying to export? If it's a manageable number, I would just use configurations and export manually. Alternatively, if you don't need individual files, you can insert multiple configurations of the same part into an assembly and export the assembly.

    As for configuring variables, if the variables can only have certain values, those values can be configured as a dropdown list. If the variables can be any value, then use a configured variable. Below is an part studio with examples of several types of configuration inputs. 

    https://cad.onshape.com/documents/57acdfaae4b005c413ed9b6f/w/3fd585a46d3af1b3ba413c53/e/b02ec721136c6121c1a02cc1
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,039 ✭✭✭✭✭
    Maybe try using this custom feature for your configurations:

    https://cad.onshape.com/documents/7cdcfcfdefc81485592c83b1

    You can then export as individual parts
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    there is Instantiator interface which allows to derive parts from one part studio to another setting configuration parameters for a source part studio, but if I remember correctly it doesn't allow continuously variable configuration parameters. so if you need a large number of instances you can use Feature pattern, but the limitation is - it can't handle external references in sketches.
  • joe_dunnejoe_dunne Onshape Employees, Developers, csevp Posts: 198
    I suspect what you are looking to do, requires the use of the API.  Export automation is possible via API. And of course you can iterate through variations via API as well.

    A manual version of this can be found here:

    https://helioztechnologies.com/onshape

    This example shows how the API can drive Onshape configurations.
    Joe Dunne / Onshape, Inc.
Sign In or Register to comment.