LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script Class's "Default Palette"?

Solved!
Go to solution

I'm looking to modify the Default Palette of a class, through scripting:

_carl_1-1675264828142.png

 

But I'm unable to find a property/method available on the class to do this. Anyone know if it's possible to script this? Thanks!

0 Kudos
Message 1 of 6
(1,332 Views)

I can't even figure out how to change it manually.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 6
(1,298 Views)
Solution
Accepted by _carl

Kyle97330_1-1675360160015.png

 

This works sometimes but sometimes gives a "library locked" error and I'm not sure what is locking it.  

 

I assume that it will only work if the menu file is a class member already...

Message 3 of 6
(1,292 Views)

@Kyle97330 wrote:

 

This works sometimes but sometimes gives a "library locked" error and I'm not sure what is locking it.  

 

I assume that it will only work if the menu file is a class member already...


Yes this is how I do it with making VIPM packages.  During the Pre Build process I will add the most root MNU that I want to the root of the class, then run that VI server command to set the class to have that MNU as the default for the class.

Message 4 of 6
(1,274 Views)

You're likely getting the library locked error because the class is being opened in multiple application instances. Make sure when you call the Library.Open method you are wiring in the App Instance to that method for My Computer, or whatever app instance owns the class. Or that the VI you're running to modify the class is under the same target in the project as the class (and not, for example, in the Main App Instance outside of the project).

0 Kudos
Message 5 of 6
(1,262 Views)

Ah, nice!  Also...this looks like a much cleaner/safer option than modifying the XML directly, which is something I've resorted to (with varying success) in the past...

0 Kudos
Message 6 of 6
(1,234 Views)