03-14-2018 08:47 PM - edited 03-15-2018 08:24 AM
The Problem:
Hello all: I'm working on creating an 'insert from clipboard' quick-drop VI based off the default 'insert.vi' from the quickdrop menu.
I'm snagged on how LabVIEW holds objects in the clipboard, for example you can copy a primitive (such as index array) and then paste it somewhere else. Outside of LabVIEW clipboard items are just bitmap data (see output from get-clipboard or 'clipboard example.png', both are the same index array primitive)
PS C:\Users\nicks> get-clipboard -format image Tag : PhysicalDimension : {Width=32, Height=27} Size : {Width=32, Height=27} Width : 32 Height : 27 HorizontalResolution : 96 VerticalResolution : 96 Flags : 335888 RawFormat : [ImageFormat: b96b3caa-0728-11d3-9d7b-0000f81ef32e] PixelFormat : Format32bppRgb Palette : System.Drawing.Imaging.ColorPalette FrameDimensionsList : {7462dc86-6180-4c7e-8e3f-ee7333a7a483} PropertyIdList : {} PropertyItems : {}
The Question:
Is there a way to access what LabVIEW code is present in my clipboard as a VI scripting action? Invoke>app>read from clipboard returns an empty string when reading from the same clipboard as above (see clipboard read.png).
Failing that, does NI document how LV items are 'rendered' to and then 'decoded' from that bitmap data? All I can find in the NI docs are references to how amazing it is that you can use vi snippets.
Solved! Go to Solution.
03-15-2018 11:15 AM
In addition to the clipboard of the OS, LabVIEW has its own clipboard.
When you copy a LabVIEW object, LabVIEW puts an image on the OS clipboard, and a copy of the object on the internal clipboard.
The is no property/invoke node to access the internal clipboard.
From the menu bar, you can import an image onto the internal clipboard. It supports alpha channel (i.e. translucent). Which can be used to customize a ctrl.
03-15-2018 11:51 AM
Thank you for your input George, My suspicion that the BMP in the OS-clipboard contained the object data was from looking at the embedded VI data in VI sinppet images.
Unfortunately the ability to import images into LabVIEW is unrelated to my goal, which is to paste items from the LabVIEW-clipboard via VI scripting.
03-15-2018 02:41 PM
For your reference, here is a modified version of the Quick Drop Replace shortcut that will replace the selected object with whatever object is on the clipboard:
https://forums.ni.com/t5/Quick-Drop-Enthusiasts/Replace-from-Clipboard/gpm-p/3521544
03-15-2018 02:48 PM
Awesome I will be messing with this all afternoon thankyou!
03-15-2018 02:54 PM - edited 03-15-2018 02:55 PM
For future reference attached vi snippet is how you access the LabVIEW clipboard (these blue invoke nodes are only available when in VI scripting mode).