LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Kosta

Programmatic Control of Grid Alignment Properties

Status: Completed

Available in LabVIEW 2019. There are two new properties of the VI class: Block Diagram Window:Alignment Grid Size and Front Panel Window:Alignment Grid Size.

I am not happy when I inherit legacy code where VIs have inconsistent alignment grid options, as shown in the image below.Inconsistent Alignment Grids.jpg

 

My team has coding standards we follow, and those standards include alignment grid options. It is labor-intensive to change alignment grid options on legacy VIs because you have to do it by hand, and clicks quickly add up. I wish I could automate such changes.

 

I’d like to see a few new properties to expose settings available in the editor, as shown below.Alignment Grid Property Nodes.jpg

These properties need to support both read and write.

Kosta
23 Comments
raphschru
Active Participant

I was also searching for this !!

I remember recovering a project made from an old QMH template, such a pain to turn FP grid size from 16 to 12 in each and every VI.

 

BONUS IDEA : Also allow to get/set Default Command Style for a new commands in a particular VI.

(Actually all editor options should be accessible programmatically Smiley Tongue)

wiebe@CARYA
Knight of NI

As an alternative, NI could let us in on how the options dialog does this.

 

That dialog is mostly VIs at work (calling it and handling the results is not, AFAIK), so there is a change it can be done already. It's just that we don't get to see all pieces of the puzzle.

 

Instead of proving property nodes and\or inside information, an API\library\set of VIs to set all options sounds great to me. And probably less work.

AristosQueue (NI)
NI Employee (retired)

The VI Properties dialog is a VI -- but its block diagram is entirely written in C, not G. This is true of most of the older dialogs in LabVIEW.

wiebe@CARYA
Knight of NI

@AQ:

 

Not the VI properties dialog, the LabVIEW Options dialog. Where you can set the FP grid properties...

Kosta
Member

There are two different places where you can set grid properties, with different scope:

  1. If you go to Tools > Options > Front Panel, you can set grid properties for new VIs. There is also a corresponding place for Block Diagram grids.Changing this setting has no impact on existing VIs.
  2. If you open a VI, then go to File > VI Properties > Editor Settings, you can specify grid size for both front panel and block diagram for that particular VI. To enable or disable the front panel grid, you need to have the front panel open, then click Edit > Enable Panel Grid Alignment or Edit > Disable Panel Grid Alignment. You enable or disable block diagram grid in a similar manner.

This idea is about programmatic access to the properties on existing VIs. 

Kosta
JÞB
Knight of NI

AQ Wrote:

The VI Properties dialog is a VI -- but its block diagram is entirely written in C, not G. This is true of most of the older dialogs in LabVIEW.


Is this in anyway related to comments in the LabVIEW help file "

This property is similar to the XXXX option"  e.g.

History:Record Application Comments Property

Short Name: Hist.RecAppComments

Requires: Base Development System

Class: VI Properties

To Use: Create a property.

Indicates whether to add comments to the VI revision history when certain events occur, such as conversion to a new version of LabVIEW, subVI changes, and changes to the name or path of the VI.

This property is similar to the Record comments generated by LabVIEW option on the Revision History page of the VI Properties dialog box

?????


"Should be" isn't "Is" -Jay
Kosta
Member

,

 

The similarity I see between the example you brought up and the 4 properties I mentioned is that they are all properties of a VI.

 

You identified in your comment a property you can set through the LabVIEW editor, in the VI Properties dialog (Record comments generated by LabVIEW) and through scripting, by using History: Record Application Comments Property.

 

If the idea listed here gets implemented, we will have four more VI properties that you can consistently set through the LabVIEW editor and through scripting.

Kosta
JÞB
Knight of NI

Actually, I went off topic.  My apologies .  That is similar to... has often bothered me.


"Should be" isn't "Is" -Jay
AristosQueue (NI)
NI Employee (retired)

> If the idea listed here gets implemented, we will have four more VI properties

 

Grid size is settable on VI as a whole, but enabled/disabled alignment is global to all of LV. There would only be two new properties.

Kosta
Member

AristosQueue,

Thank you for the correction: I can indeed control enabled/disabled alignment via LabVIEW.ini tokens, so I we need are two new properties.

Kosta