Jump to content
News about the LabVIEW Wiki! Read more... ×
Tripmeister

Add editor tool, that does not use Plugins as Quickdrop or Rightclick

Recommended Posts

Hi everyone,

I would like to program some little extra functionality to the Blockdiagram Editor. In detail I want to write a tool, that allows me to drag a node over a wire and then automatically inserts it to the wire if it fits (e.g. drag a subVI into an error-wire). I guess I know/can figure out how to write that functionality using VI scripting, but I'm not sure how to implement it to run whenever I edit a VI.

My first approach is to write a simple scripting-VI, that I will run whenever I need the functionality (or just place the exe in autostart). This VI will obtain the reference to the currently active blockdiagram and then uses scripting to move the node into the wire, whenever I drag a node.

But this seems very inefficient, though I know that controlling a drag-operation via VI-Server is inefficient anyway.

 

My basic question is:

Is there a way in LabVIEW to implement LabVIEW-Written functionality to the whole editor?

 

So I don't want to activate anything via Right-Click- or Quickdrop-Plugins. It should be a background VI running constantly, or maybe a solution using internal LabVIEW-Events such as starting a drag-operation on the blockdiagram.

It would be great, if anyone can give me hints or maybe even examples for how to solve this. I would be happy about any different ways on implementing the functionality from my first sentence, but basically its not about the functionality itself and more about curiosity on if there is a way to solve it all using LabVIEW. Maybe I want to write different tools as well then.

 

Thanks for any replies in advance!!

Best,

Jan

Share this post


Link to post
Share on other sites

There are a couple of tools that come to mind which spawn a VI to run, and then stays running, and monitors your development environment and can do things, based on actions.  One is CaseSelect which is a window which helps visualize nested case structures by allowing to collapse sections of it like a tree instead of a single listbox.  It looks for the selected item to be an event structure and then does work if it is.  It gets invoked with either QuickDrop or a right click but then stays running and monitors what items you are selecting.

I'd guess you could do something like this, to spawn a VI that runs continuously and monitors if you are dragging (mouse down+moving+single node selected) and then detect if you are on top of a wire (correlate mouse coordinates with BD objects), then read the data type of the wire, and if an insert is possible, then maybe give a visualization that an insert is going to take place (maybe a semi-transparent VI overlayed on top of your mouse, or changing the mouse pointer?) then invoke the same scripting code that does the insert with QuickDrop.

Lots of work, it probably wouldn't work well, but if you do get anything useful going feel free to post what you've come up with.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

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