Jump to content
Thoric

Get datatype primary color

Recommended Posts

I'm looking for a way to get the color of a datatype wire, i.e. as it would appear in the connector pane for an associated front panel control.

 

A little more detail: Take a standard VI with a handful of controls and indicators wired to the connector pane. Each datatype's core wire color is shown in the associated connector pane terminal box. Can you programmatically retrieve this color for any datatype?

 

What I've tried:

I've looked for a "datatype" property node in the hope of extracting further information, but not sure that's helpful.

I've played around with the Class Identifier for a control reference, but not sure what use that really is?

I've looked for a way to grab an image of the connector pane's terminals to grab the color from the filled rectangles. I can only seem to get the VI icon with the connection text as seen in context help.

 

Any ideas?

Share this post


Link to post
Share on other sites

Use the default value property (assuming you have a control reference) as input to the Application Method aptly named "Data Type Color".

 

This is where the class browser Ctrl-Shift-B comes in very handy.

 

Also works in conjunction with wires and control terminals.

  • Like 2

Share this post


Link to post
Share on other sites

I used that method when writing this VI, which programmatically generates an image of a VI's connector pane terminals.

 

http://lavag.org/topic/16581-get-connector-pane-32x32-image-looking-for-better-idea/?p=101586

 

I wrote a VI like that a while ago too! Only instead of a VI's terminals, it draws an Xnode's terminals, from the cluster returned by its GetTerms4 ability VI. And yes, it also uses that method.

Edited by flarn2006

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.