Example Code

Programmatically Move Block Diagram Elements

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This VI demonstrates how to programmatically move items on a separate VI's Block Diagram.


Description
Here is a brief description of the example:

This example uses VI Scripting to select all elements on the Block Diagram and move them to line up with the origin. The methods and properties shown in this example can be used to move part or all of the Block Diagram elements to any relative or absolute location on the Block Diagram

 

Requirements

  1. LabVIEW 2013 (or compatible)


Steps to Implement or Execute Code

  1. Download and Open the VI
  2. Open a separate VI to see effects of this example
  3. Enter the filepath of the separate VI in the VI Path control
  4. Run the VI
  5. Notice the Block Diagram elements of the separate VI move to the origin (easy to see if you have the Block Diagram Grid enabled). Also note that the code retains the same shape, form, and position relative to other elements.
  6. Move the code on the separate VI
  7. Rerun the example VI
  8. Notice the Block Diagram elements move back to the same location as before

 

Additional Information or References

VI Snippet

Programmatically Move Block Diagram 2013 NIVerified.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Cameron T
Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.