From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
CMW..

"Delete all BUT This" in Context menu for case structure

Status: New

Hey,

 

how about a "Delete all But this" (similar to Notepad ++) for cases in an case structure. This would save the case-structure and the code inside for the selected case.

I know, that I could delete the structure, keep the active case and get a new case structure around that piece of code...but that's not comfortable.

AllBut.png

Regards,

CMW..

9 Comments
altenbach
Knight of NI

We already have "remove empty cases". Deleting lots of code contained many other cases unseen seems dangerous to me. How often do you really need this?

jcarmody
Trusted Enthusiast

Remove Case Structure will do what you're asking. 😄

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

pete_sch
Member

Great Idea!

kosist90
Active Participant

There's no sense to delete all cases except current, and anyway to create new cases (b/c if you have only one case, then there is no need in case structure).

CMW..
Member

I wouldn't say, that "there's no sense to delete all cases". I know (btw. exactly what I was telling  in the original post Smiley Happy) that we could easily remove the case structure and wire a new one if needed or just delete empty cases.

But I had this issue a few times so I thought it would be helpful.

 

After rethinking my suggested idea, please  let me modify my original post.

 

It would be even better, to select the cases you want to delete:

 

In a case with e.g. "Init - Action 1 - Action 2 - Achtion 3 - Deinit" you could select the Actionsteps to delete, -> set cases for every value and just redo the action steps.

Isn't it comfortable??

original.png

Feel free to answer, this one is now up for discussion....

Regards,

CMW...

 

RavensFan
Knight of NI

This looks like a good idea.  But I personally don't see a whole lot of benefit over just selecting each case and deleting them individually.  While I can see a slight time savings with what you propose, I don't think I would ever use it often enough to make it worthwhile having that option.

elset191
Active Participant

I could have used this a few times lately.

 

As an example, I had a case structure with an enum selector, and I created a case for every value.  I wired up the first case, then realized the rest of the cases were not terribly different from this first one.  I wanted to delete all the cases for the other values and duplicate case for each new one.  As Ravens suggests, I just deleted all of them individually and it wasn't too big of a deal.

--
Tim Elsey
Certified LabVIEW Architect
kosist90
Active Participant

Selective delete - interesting idea, this I like more ))) It will be useful feature, I suppose. But if to think more logically... When we want to delete cases from case structure?

1. When there are cases pages for all cases, and some of them are empty, b/c we will not use those cases. But now it's possible to delete all empty cases.

And others cases, when it's needed to delete some pages from case structure don't come to my mind... B/c, why we need multiply selector of cases (states), and case structure, which will hold only couple of possible states?

 

So, there are low chances, that NI guys will implement it... But overall idea is good 😃

jcarmody
Trusted Enthusiast

My CaseSelect Quick Drop Plugin can be used to delete cases.  You can use the 'Delete' key instead of the right-click menu.  It doesn't support multi-select, it returns focus to the block diagram window (you can't simply hit 'Delete' several times without reactivating CaseSelect) and there's a slightly annoying error that happens if you try to delete a second case...  Other than that, it's perfect 😄

 

caseselect.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7