To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This examples demonstrates how to programmatically find the size of the block diagram in pixels.
Description
For block diagrams and front panels, there is a maximum size limit. More information on this can be found here. Ideally, with good programming practice utilizing concepts such as subVIs, this size limit can be avoided. However, if there is concern about excessive block diagram size, this example provides a way to determine the pixel size.
This example uses an Invoke node referenced to the current VI to extract information on block diagram size. Using the Block Diagram’s Get Image Scaled method, we can retrieve Image Data which contains a cluster containing the coordinates of the rectangle bounding the block diagram. The upper left corner of the block diagram is considered (0,0) so the pixel size can be determined with the Right coordinate and Bottom coordinate. In other words, the size of the block diagram would be <Right Coordinate> pixels by <Bottom Coordinate> pixels.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.