Jump to content

How to get the class name of LabVIEW Class Constants on the block diagram


Recommended Posts

I am trying to automate some housekeeping tasks and have run into a problem.

I decided to rename some classes in my project.  In several VIs, I place those classes as block diagram constants.  I usually display their labels when I do this for readability.  Unfortunately, when I rename the class, the labels do not update.  (Fixing this would be a nice Idea Exchange feature).

So, I decided to write a little scripting VI to go though my BDs and find all objects of type LabVIEWClassConstant and then extract their new class name and use it to change the label.  I have done this in the past with front panel controls successfully by using the TypedefPath property to get the class name.

So, I traversed the BD and returned an array of LabVIEWClassConstant refs.  These were returned as GObjects so I had to cast them to LabVIEWClassConstant type before I can access the TypedefPath property.  But when I do this, the value returned from the TypedefPath is empty.  I am guessing this is because the cast loses the object's identity and makes it a generic LabVIEWClassConstant.

So, now am stuck.  Unless I find a way to get the actual class name, I cannot fix the label and must go manually fix it on every BD. :frusty:

 

I think I am about to add VI Scripting to the realm of regular expressions. In other words, if you have a problem and you decide to solve it using VI Scripting, now you have two problems. :rolleyes:

 

thanks for any ideas or pointing out obvious mistakes/misconceptions I may have made...

 

-John

 

Link to comment

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.