LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding VIs from Class Palette

Solved!
Go to solution

If I have a class wire, and right-click on it, there's a menu option to view the class palette.

 

This palette will show every VI and typdef in the class, whether public or private.

 

Is there anyway to modify what VIs are shown on this palette?  I have classes that are exposed to users as part of an API, there's no reason for them to ever see internal typdefs or private methods here...

0 Kudos
Message 1 of 12
(1,655 Views)

Are they actually going to be able to get to the block diagram?  That seems more dangerous than them being able to see what's inside the classes.  And if, by "users" you mean "developers", why would you not want them to see this?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 12
(1,644 Views)

Let's say my class consists of 50 VIs.  10 of them are public methods.  40 of them are private utility VIs.  Perhaps there are some private typedefs too.

 

All of these will show up in the auto-generated palette when you right-click on a class wire.

 

However, if you're working in a block diagram that's not part of the class, only the public VIs of this class can be used (since the others are out of scope).  The rest are just noise.

 

(And no, the class VIs would be password-protected so that users (developers) couldn't access the block diagrams of the class VIs)

0 Kudos
Message 3 of 12
(1,629 Views)

I'll second the level of noise of that palette not filtering by scope. Especially in classes with multiple levels of hierarchy that palette almost becomes useless. I'm commenting to tag along if anyone has a solution to this. Maybe I'll throw developing a right-click plugin onto my todo list.

~ Self-professed LabVIEW wizard ~
Helping pave the path to long-term living and thriving in space.
0 Kudos
Message 4 of 12
(1,623 Views)

@_carl wrote:

Let's say my class consists of 50 VIs.  10 of them are public methods.  40 of them are private utility VIs.  Perhaps there are some private typedefs too.

 

All of these will show up in the auto-generated palette when you right-click on a class wire.

 

However, if you're working in a block diagram that's not part of the class, only the public VIs of this class can be used (since the others are out of scope).  The rest are just noise.

 

(And no, the class VIs would be password-protected so that users (developers) couldn't access the block diagrams of the class VIs)


Oh, I get it now.  It just becomes very unwieldy.  Sometimes "the more, the merrier" doesn't apply.  It would be nice if you didn't have to wade through stuff you can't use.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 12
(1,564 Views)

Perhaps better illustrated with images. Anyway, thought I'd check to see if there was anything I was overlooking first, but... guessing I'm probably not missing something obvious. Moving this to the idea exchange! 

 

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/On-auto-generated-class-palette-properly-scope-availa...

0 Kudos
Message 6 of 12
(1,561 Views)

This was a while ago but I think I already made an edit that did something like this because I also thought it was silly.

 

This functionality is implemented through a right-click menu plugin which (at the time) was completely unlocked so I just added some filtering which would take the list of all member VIs (including private) and remove from the list any private VIs that weren't part of the current class selection.

 

https://lavag.org/topic/21514-when-did-this-happen/#comment-131576

Matt J | National Instruments | CLA
Message 7 of 12
(1,548 Views)
Solution
Accepted by topic author _carl

You know you can just make a custom palette menu for a class, right?

 

1. Use the standard palette editing tools in the Tools --> Advanced --> Edit palette set to create a custom palette for your class

2. When you're doing this, make the new palette a ".mnu" file and save it in the same directory as your .lvclass file

3. Finish your palette, exit and save changes

4. Go to the class, do the right-click "Add --> File..." option, and add the new menu file

5. Go to the class properties, and on the General Settings tab, find the dropdown for "Default Palette" and choose the .mnu file in question

 

Now whenever you right-click that you get your custom palette instead of the premade one that has everything in it.

Message 8 of 12
(1,535 Views)

@Kyle97330 wrote:

You know you can just make a custom palette menu for a class, right?

 

1. Use the standard palette editing tools in the Tools --> Advanced --> Edit palette set to create a custom palette for your class

2. When you're doing this, make the new palette a ".mnu" file and save it in the same directory as your .lvclass file

3. Finish your palette, exit and save changes

4. Go to the class, do the right-click "Add --> File..." option, and add the new menu file

5. Go to the class properties, and on the General Settings tab, find the dropdown for "Default Palette" and choose the .mnu file in question

 

Now whenever you right-click that you get your custom palette instead of the premade one that has everything in it.


Now you "just" have to do that for every custom class you use, and also remember to do it for every new one as well. I believe the desire is not to have to do that at all. I gave a Kudo to the linked Idea Exchange post.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 9 of 12
(1,529 Views)

@Kyle97330 wrote:

You know you can just make a custom palette menu for a class, right?


 

No -- no I did not know that that hidden feature existed.

 

Certainly isn't a great general purpose solution, but, I think that might just work in my case.  Thanks!

0 Kudos
Message 10 of 12
(1,522 Views)