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.

Suppressing Variables in a Dimension

Michael_CoffeeMichael_Coffee Member Posts: 91 ✭✭✭
I have a part feature that is dependent on multiple variables and these drive values in a configuration table. If I configure one of those variables to be suppressed, the sketch goes red and it will not compute anything. Is this intentional (I suspect it is) and if so, has anyone made an improvement request for it? I would really like it to be able to handle suppression of a variable, because as a consequence, I now have to create five other features to handle when that variable isn't factored into the model. Ugh x.x Thankfully, it doesn't affect the model regen time any more than normal.

Answers

  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    What expression do you have in the sketch? 
    How are you using the variable that now doesn't exist?
    Hard to suggest anything without fleshing out the detail a tad. :/
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • Michael_CoffeeMichael_Coffee Member Posts: 91 ✭✭✭
    @owen_sparks

    Link down below for an example of what I'm doing. Of course, it's an incredible simplification, but it gets the point across. There's a dimension with two variables in how it's computed. Say #V1=10 & #V2=3. Together they make 13. If I wanted to suppress #V2, but still use it, it gives me an error. 

    What has happened since my last post is that my work around has not worked as well as I first thought >.> I didn't realize I ended up making another "part" in the studio and ended up accidentally deleting the original data set that I needed. Thank goodness for versions @.@ Back to the drawing board.

    https://cad.onshape.com/documents/60063a5e668f6d9233f4f82e/w/eeccd61290c694ef3b334ad4/e/b3c4cf52f8f384654fe5071c?configuration=List_H68a1qc6Af5rK0=_4_
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    If you suppress a variable I would expect all features dependent upon it to fail. Seems logical. Can you configure the variable to zero instead?
    Senior Director, Technical Services, EMEAI
  • Michael_CoffeeMichael_Coffee Member Posts: 91 ✭✭✭
    Unfortunately no. If it was set to zero, another feature would cease to exist and something else would turn red. I realized after work that if suppressed, it wouldn't be a simple "it defaults to zero", because variables used in some equations such that if it's zero, it'd cause the whole thing to go to zero (ex. multiplication). I don't want to imagine the havoc that would cause.

    To get where I needed to be, I did a few "Move Face" features and put in some equations to calculate everything out. Surprisingly, it didn't turn out nearly as bad as I thought it would. I think that's the SolidWorks experience in me talking =P With SW, it was like holding my breath whenever I did anything to something complicated. Thankfully, the face features only added about 20ms to the regen time and that's perfectly fine with me. I was surprised though that you cannot put the absolute value function [abs()] inside of a configured table. Is this intentional or an error? I haven't tried any others yet.
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Jake Rosenfeld - Modeling Team
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @Michael_Coffee

    `abs` needs to be lowercase.  Expression execution here uses FeatureScript as its engine, so you are basically calling directly into FeatureScript when you type an expression like this.  In general, all of our FeatureScript function will be in camelCase.  You can search through this page to see if something exists: https://cad.onshape.com/FsDoc/library.html, but luckily we recently added autocomplete to all fields that take expressions, so as soon as you type `ab`, `abs` will probably show up as an option and you can press enter to finish the autocomplete.

    I suspect that you got here by copy-pasting from excel or similar though?
    Jake Rosenfeld - Modeling Team
  • Michael_CoffeeMichael_Coffee Member Posts: 91 ✭✭✭
    Ah, I should have known. I've worked with coding before and it should have been the first thing I checked, but it's been a few years =P So yep, it worked just fine once everything was lowercase. Thank you =)

    I actually typed everything uppercase into the configuration table, which would explain some other issues as well I had. I tend to not copy-paste from one program to the other, purely because all of the data I'm working with isn't organized to do that. The amount of time needed to organize everything before hand in excel to paste into Onshape would far exceed just putting it in as we need it. We are migrating from SW, so we are putting stuff in as needed (a never ending process, of course). Considering the amount of files we've collected over...40-ish years...I'll take the slow path =P
Sign In or Register to comment.