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.

Variables in Configuration

turan_aydinturan_aydin Member Posts: 12 ✭✭
Is there any "trick" to assign Variables to the values in Configuration table or this is not implemented yet? 


  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,396
    What are you trying to do?
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 994
    Configuring variable values should work -- configure them like you would any other feature (e.g., edit the variable, right click on the field where you would enter the variable value and click "Configure").
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,448 PRO
    I think @turan_aydin wanted to use variable in configuration table as value.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,396
    In that case, yes. Just put # before the variable name in a cell. 
  • jerome_goyetjerome_goyet Member Posts: 11

    About configuration variables, I'm currently facing the follwing issue :

    With reference to this document (part studio 1 _ version B2_janv2018) : https://cad.onshape.com/documents/9181221e67016abc6e611600/w/1177aed0fb69afc9f9fdb1bf/e/5d9c264a121f1f416843aa28

    in the linear pattern 2 feature, the instance account is set with the '#nbr_ventaux' variable; this variable is defined in the configuration variables.
    Graphically, this linear pattern works correctly when the variable is set to less than 5; then, when it is greater than 4, only 4 instances are displayed.

    I cannot figure out if it is an issue related to the variable or a video generation issue ?

    Would you have any hints about that kind of issue ?

    Many thanks
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,396
    @jerome_goyet the issue is with your transform feature. As more instances are added, the transform feature does not know about them. You can change the variable to the maximum value it will ever be and add the extra instances to your transform feature. This should have been modelled in meters from the start.

  • jerome_goyetjerome_goyet Member Posts: 11
    Got it!! Many thanks for your prompt response!
  • turan_aydinturan_aydin Member Posts: 12 ✭✭
    yes @3dcad, I want to set variables in configuration table , but @NeilCooke I'm not getting how to do it. Example , I have prism  L100 x H50 x D25.
    And I want to define it as L = 100 , H=L/2 , D=H/2
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 504
    If the variables H and D only depend on length, they do not need to be configured.

    Here's an example accomplishing what I think you're saying:

  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,448 PRO
    But what if you wan't to chance the way how they depend on each other according to configuration?
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,396
    In that case you would configure Height and Width variables and enter #Length/2 etc, into the table cells?
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Nice example in the demo video whereby a shaft diameter is set with a logic driven expression.  So if shaft length over a certain value make it thicker.  Even has a chap with a proper accent narrating it o:)

    Business Systems and Configuration Controller
    HWM-Water Ltd
  • bruce_williamsbruce_williams Member, Developers Posts: 544 PRO

    Something like this?  and as @owen_sparks points out, the video shows a nice conditional formula.  

  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,448 PRO
    Probably so, for some reason OP had difficulties on performing that..
  • turan_aydinturan_aydin Member Posts: 12 ✭✭
    @bruce_williams Thanks,. exactly !!! 
Sign In or Register to comment.