Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SAC: Improved Switch Options

SAC: Improved Switch Options

Right now Switches require that each option have a hard-coded string to test against.

 

I propose allowing expressions of any kind in each "Case" branch.  Instead of needing to use an extensive Decision tree such as the first image below (or even MORE extensive), I could use a Switch as shown in the second image.  The "Expression" for the Switch object would just be TRUE.  Then each Case branch would test their given expressions to see which one is TRUE.  You might need to make it so that the user can specify the ORDER in which they get tested.

 

SAC Switch Improvement1.png

 

SAC Switch Improvement2.png

3 Comments

This one should be doable in the program if I get what you are asking. You can use an IF statement to return a string value and then use the resulting string to control the switch. To do multiple values you would do multiple IF statements like this.

 

IF(A=3,"Case1",IF(A=5,"Case2","Case3"))

 

Here is a simple example as a link since I can't upload a file. It looks like you are trying to apply the Civil 3D Expression rules to SAC and not noticing you can return a string value in SAC, which is really a wish I have for Civil 3D expressions to do the same.

doni49
Mentor

Yes that would work in this limited example.  But I'm wanting to get away from a complicated if statement -- that's not any better than a complicated decision tree.  In fact at least with a decision tree, it's a little more visual so it's easier to follow.

 

In this example, there are only 3 possible options.  What happens when there are 5?  More?

 

EDIT:  My example above has 4 possible options.  The example you posted only has 3 which is already less complicated.

This still has the complicated If statement, but helps in following the one that is being used by putting the formula that is being used as the case solution. 

 

Switch.png

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Answer Day

Rail Community


 

Autodesk Design & Make Report