03-20-2009 11:01 AM
I know I can disconnect a control from a type def, but can I "connect" (link) a control to an existing type def?
I'm trying to do this because sometimes I have a customized control that I've made by editing picture items, sizes colors and fonts and so on, and I'd like to use it in another project. I can copy it over easily enough, but how the heck do I link it to the existing type def in the other project?
-root
Solved! Go to Solution.
03-20-2009 11:19 AM - edited 03-20-2009 11:20 AM
I can suggest the following:
1) make a copy of the customized control (I guess it's a .ctl) in a new directory
2) open the ctl and resave it as a typedef with the same name of the typedef in the other project
3) create a new vi pasting a control (now typedef) on the front panel
4) copy the vi (not the ctl) to the other project and open it: the control should "connect" to the existing typedef
Of course, be very careful not to overwrite any existing file.
03-20-2009 01:00 PM
03-20-2009 01:16 PM - edited 03-20-2009 01:19 PM
nathand wrote:
The easiest way to replace an existing control with a type definition is to right-click on the control border in the front panel, click Replace->Select a Control... and find your type definition. Does that achieve what you want? Make sure you're using strict type definitions if you're modifying colors and other appearance properties.
That is the method I use but be DAMN sure you you are pointing at the right widget in the right folder to avoid cross linking etc.
THe big plus with doing the replace is that it takes care of all property nodes and events cases as well.
Ben
PS: Nice signature! Let's keep them robots happy.
03-20-2009 01:30 PM - edited 03-20-2009 01:32 PM
Ahhhh! nicely done, pink panther! the ol' switcharoo. I tried the other method listed. I might be doing something wrong, but using "replace" wiped out some of the custom settings on the control. pincpanter's method seems to work fine, though. thanks!
-root
05-18-2020 04:12 PM
Hello Pincpanter,
I am new to Labview and I'm trying to add a control to an existing type def.
When you say the following -
3) create a new vi pasting a control (now typedef) on the front pane
(Are we creating the new vi within the current project?)
I am asking because I get conflicts within the project if I open a new VI inside project explorer.
Thank you for your response
05-19-2020 02:40 AM
Hi dhenry,
@dhenry wrote:
Hello Pincpanter,
I am new to Labview and I'm trying to add a control to an existing type def.
When you say the following -
3) create a new vi pasting a control (now typedef) on the front pane
(Are we creating the new vi within the current project?)
I am asking because I get conflicts within the project if I open a new VI inside project explorer.
Which kind of "conflict" do you get when you create a new VI "inside project explorer"?
05-19-2020 10:58 AM
Thanks for your reply GerdW - I realize this was a post from 2009 so I'm not sure if it applies to LV 2018
Here are the steps I followed according to the post -
1) make a copy of the customized control (I guess it's a .ctl) in a new directory
2) open the ctl and resave it as a typedef with the same name of the typedef in the other project
3) create a new vi pasting a control (now typedef) on the front panel
(Here is where I'm getting the conflict)
When I name the control the same name as the typedef as suggest by the post, this is the conflict that I am getting.
4) copy the vi (not the ctl) to the other project and open it: the control should "connect" to the existing typedef
This is a practice VI before I perform the action on the actual program.