10-25-2018 05:22 AM
Hello VIA enthustiasts,
I need to remove almost all case structures quickly from a large project. First idea that comes in mind is to write a small VIA test that uses the code of the right-click plugin Remove and Rewire Objects. Everything works fine in debug mode, but when I run the test with VIA on my project nothing happens! No error, but no case structure removed.
Any idea ?
Thanks,
Olivier
10-25-2018 10:33 AM
I'm guessing it has something to do with undo transactions. Are you calling the following core scripting VI?
vi.lib\Utility\QuickDropSupport\Remove and Rewire Objects_core.vi
That's the VI you should call, calling anything higher level than that may result in unexpected behavior.
If you're still having issues, can you post the problematic test LLB so I can debug it?
10-26-2018 01:54 AM
Hi Darren,
Yes that the VI I use.
Here is the llb, thanks in advance for your help.
Olivier
10-26-2018 11:43 AM
I ran your test both in debug mode and with the VI Analyzer and it worked both times, the case structures in my VIs were removed. A couple of things to think about:
1. Are any of the files you're analyzing read-only? I would expect the save method to error out in those cases, but I thought I'd ask.
2. I think you should wire the error terminal from the Remove and Rewire subVI to the error out of the test. If that subVI errors out, your save method won't execute. But you also won't see the error either.
3. This shouldn't cause an issue, but I noticed you don't have anything specified in the RD VI for the test. I think you'll be fine with "Other" > "Panel" in there. Here's the page that describes the RD VI "Other" options in detail.
10-27-2018 09:58 AM
I made changes you advised in 2. and 3. and test worked. Not sure it's related, but...
For the record, modification of this test seems to mess up the project. Hundreds of warnings like the one below appear at the end of the analysis process.
Anyway, I obtained the code I want much quicker than with manual modification.
Thanks for your time and your help Darren.