Showing results for 
Search instead for 
Did you mean: 

Script the Creation of a Picture Constant

Go to solution

I'm trying to write a script that creates a picture constant.  I can do that by using the "Move" method to make a copy of an existing picture constant.  But the "Move" method doesn't give a reference to the newly created picture constant, so I have to write code to hunt for it.  Is there a cleaner way to do this?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 4

Here's how I would do it:


1. Have a stub subVI that contains a picture constant.

2. Use scripting to drop that subVI on the target diagram.

3. Call the 'Inline' method of the subVI class on that new subVI, and wire TRUE to the 'wrap in sequence' parameter.

4. The method returns a reference to the sequence that was created. Call Traverse for with a traverse target of 'Other', and wire the Sequence reference as the Other reference, and traverse for constant. The resulting reference is the new picture constant.

5. Call Remove Structure on the created sequence.



DNatt, NI
0 Kudos
Message 2 of 4
Accepted by topic author paul_cardinale

Create a control, get the ControlTerminal reference and change it to a constant.

Message 3 of 4

Ooh, I like Darin's answer better.

DNatt, NI
0 Kudos
Message 4 of 4