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.

Too small variable field

sergei_nesterovsergei_nesterov Member Posts: 45 ✭✭
edited April 2020 in Product Feedback
I create a variable and enter a very long formula. The program gives me an error, but since the field is very small, I can't view the entire formula, which makes it difficult to find the error. The same problem exists in sketch mode when setting the feature size. Therefore, I ask you to make the fields where you can enter formulas changeable depending on the size of the formula (the content of the field). 

Comments

  • Ethan_KEthan_K Member, Onshape Employees Posts: 57 image
    One solution to this that sometimes makes sense is to break your formula into smaller logical 'chunks'. For instance, I see you are taking a floor() of some dimension, which means you are probably determining some number of x to place along y. So in this situation, you may consider making an intermediate variable in the feature list to represent num_x, for instance. In general, it is best to break apart long functions into smaller logical steps - this also helps find duplicate logic, so you can just reuse the same intermediate variable instead of rewriting that part of the formula each time. I agree, though, that the length of the text field is a bit small!
  • erik_pleskoerik_plesko Member Posts: 6

    I am also bothered by the sketch dimension input field being too small. Not even a full variable fits in. (since scope of variables is global, their names are bound to be longer).

    image.png

    A workaround I figured out is to make a new variable for that input field (overhead that i don't like). The variable editing window can be resized with the mouse (clicking and dragging it's right edge). This provides sufficient space for formulas. And is probably also a solution your struggle @sergei_nesterov.

    image.png

    The drawback is that more variables get created in the features list and clutter the workspace a bit. Having the option to have variables being local to a sketch would help here.

  • erik_pleskoerik_plesko Member Posts: 6

    I also struggle with the fields far too small. I want to do a difference between two variables. And not even one variable fits into the display field.
    How could I edit the equation better? - meaning see more of it while editing.

    (when hovering with the mouse the whole field gets displayed - i can't screen shot it - which is nice to inspect. It would be awesome to also have a bigger field for editing)

    I'm using a wide screen, so there is really a lot of (unused) space on my screen.

    image.png
  • klaus_krämerklaus_krämer Member Posts: 77 ✭✭✭

    Hi Ethan, I've been tempted to give you a "Vote down", as you seem to be an Onshape employee, but that wouldn't be nice, since you wanted to help.

    I find the small input fields very bothersome and thus annoying. Meaningful variable names simply take more space. Add functions and you'll never see the whole formula, even if they are short and simple The missing overview facilitates input errors and makes finding them even harder.

    As parameterization is essential, why does Onshape not aim to make this important part more user friendly?

  • Matthew_CurranMatthew_Curran Member, csevp Posts: 23 PRO

    @klaus_krämer Please excuse the poor quality. But you've been able to click and drag to make the dialog boxes in Onshape wider for a while.

    test gif.gif
  • eric_pestyeric_pesty Member Posts: 2,394 PRO

    But not the input boxes in sketches so if you want to use expressions in the dimension input it's still a pain…
    Creating an extra variable just to be able to "comfortably" edit it is still just a "workaround"…

  • Matthew_CurranMatthew_Curran Member, csevp Posts: 23 PRO

    @eric_pesty I feel like putting a long expression in something as non-reusable as a sketch dimension is a poor modeling practice. It's very rare that I only need a part or all of that expression only once. That's why I don't see the variables as a workaround, but not everyone has the same standards.

  • eric_pestyeric_pesty Member Posts: 2,394 PRO

    I would agree "in general" but there are definitely cases where you might use different combinations of a few variables within a sketch and creating multiple variable for these actually makes things more confusing.
    One example would be adding or removing an offsets for different sketch entities, and maybe adding a clearance variable or something…

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 287 PRO

    I'm in the camp that if you find yourself writing out a novel in expressions and variables you're probably better off breaking your problems into smaller chunks or relying on one of the many excellent custom features to solve the problem without needing to mentally juggle the constraints and operations in the abstract sense. I've had to go back and decipher some "clever" algorithmic models later when one of the core assumptions they were built on changed and it's so much less readable to bake all of your engineering into a single text field than to lay out multiple clear steps of calculation or to use something like Evan Reese's Linear Pattern Plus that has the rounding and flooring functions baked in.

  • S1monS1mon Member Posts: 3,637 PRO

    I agree with @Derek_Van_Allen_BD , but I also think that the fields are criminally cramped. I've suggested a few times that doing something like a spreadsheet program where there's a separate entry field which is much longer could make a lot of sense. I like being able to resize some of the dialogs, but it's a bit odd sometimes finding the hot spot to drag, and most of the time I don't need them to be a mile wide - except sometimes with expressions.

    Simon Gatrall | Product Development Specialist | Open For Work

  • rick_randallrick_randall Member Posts: 405 ✭✭✭
    edited October 20

    This tip doesn't change the size of the box, but by using the right or left arrow keys, you can shift the cursor to any location in the formula - at least you can find the end of it. Sorry if this seems obvious - and I do agree these boxes should be sizable.

  • klaus_krämerklaus_krämer Member Posts: 77 ✭✭✭
    edited October 21

    @Matthew_Curran It's not only about longer expressions, but also using meaningful variable names, as we do in coding, too. My variables mostly begin with a Prefix like "L_" indicating it's a length or "W_" indicating a width and so on. That results in variables like "DI_Funneloutlet" which is easily to understand as inner diameter of a funnel outlet. So these way too small input fields are a nuisance, even if you do only smaller calculations such as dividing it by 2 for getting the radius where you need one. Or having to use Two or three such self speaking variable names in such a cramped input field.

    I am with you, if you need some similar calculations at least more than twice. Then my choice would be to create a new variable like using methods or subroutines → resulting in another self speaking variable name - probably too long for that darn input field.

    I simply cannot understand, why you are vehemently defending an obvious lack in user friendliness and usability..

  • MDesignMDesign Member Posts: 1,166 PRO

    What rick said ^^^^

  • Matthew_CurranMatthew_Curran Member, csevp Posts: 23 PRO

    "vehemently defending" is wild. I do agree that it should auto-resize as you type as @rick_randall said. But if you have a problem with the system, then either upvote an existing improvement request, or make one yourself (see pinned forum post). I'm assuming that if someone is posting/commenting in other categories that they're looking for help or a solution, not a change to the program itself.

    I did a quick search for any existing improvement requests for this functionality and couldn't find one. Probably just my poor searching skills though.

  • klaus_krämerklaus_krämer Member Posts: 77 ✭✭✭
    edited October 22
Sign In or Register to comment.