Display of enum for feature type in custom features
lemon1324
Member, Developers Posts: 230 EDU
Is it possible to get a feature-type enum to display as "tabs" rather than a drop-down like it does for the native boolean operation?

I was able to do this in a custom feature if I declared a BooleanOperationType enum and imported onshape/std/booleanoperationtype.gen.fs at the top, but not if I defined my own operation type enum. In both cases it was the first enum in the feature definition and as far as I can tell I had equivalent code. I didn't see anything in the documentation either. What am I missing?

I was able to do this in a custom feature if I declared a BooleanOperationType enum and imported onshape/std/booleanoperationtype.gen.fs at the top, but not if I defined my own operation type enum. In both cases it was the first enum in the feature definition and as far as I can tell I had equivalent code. I didn't see anything in the documentation either. What am I missing?
Arul Suresh
PhD, Mechanical Engineering, Stanford University
PhD, Mechanical Engineering, Stanford University
Tagged:
0
Best Answer
-
Yes, currently BooleanOperationType, NewBodyOperationType, and a few other enums are special-cased in our UI to behave this way. It's not a style that can be applied to any enum (for now). This isn't a totally trivial change since those enums' text is specially designed to fit on one row, and we need to figure out how to keep the dialog looking clean if and when that text overflows.
5
Answers
-
I'd also be interested in this answer, I wondered the same thing at one point but just ended up assuming it was built-in magic not accessible for users.0
-
Yes, currently BooleanOperationType, NewBodyOperationType, and a few other enums are special-cased in our UI to behave this way. It's not a style that can be applied to any enum (for now). This isn't a totally trivial change since those enums' text is specially designed to fit on one row, and we need to figure out how to keep the dialog looking clean if and when that text overflows.
5


