11-19-2019 07:16 AM
This simple test puzzles me.
This is the result:
I cannot see any relation between location assigned when Flat Sequence Structure was created (30 and 10) and positions read afterwards.
Could you give me a hint how do location values used with New VI Object related to positions of objects in BD.
Thank you.
Solved! Go to Solution.
11-19-2019 07:21 AM
The flat sequence structure is the object that is on the main panel of the block diagram.
The flat sequence structures contain one or more flat sequence frames. Those frames are owned by the sequence structure and their positions are relative to that sequence structure.
11-19-2019 08:33 AM
@RavensFan wrote:
Those frames are owned by the sequence structure and their positions are relative to that sequence structure.
It was my first guess disproved by this test. Position values are probably related to the same coordinate system.
11-19-2019 08:47 AM
I thought you were talking about the frame being at position 0,0?
11-19-2019 09:21 AM
The position you set when you create the object (30,10) is in the coordinate system of the owner, in this case the FSS frame. The position you read is in the coordinate system of the block diagram.
The origin of the FSS frame corresponds to the origin of the diagram. This is offset from the position of FSS itself by the filmstrip border. A similar offset is there for loops and other structures.
From the offsets in position values (36,20) we can infer that the FSS border is 6 pixels wide and 10 pixels high.
The moral of the story is that if you want to predict the final location of the created object inside a structure you have to take the border size into account.
11-19-2019 09:24 AM
Same thing with cluster constants.
It's an old quirk. When you create the object, the position is relative to the owner.
When you read the position, it's relative to the top level diagram.
11-19-2019 11:25 AM
@Darin.K wrote:
The position you set when you create the object (30,10) is in the coordinate system of the owner, in this case the FSS frame. The position you read is in the coordinate system of the block diagram.
The origin of the FSS frame corresponds to the origin of the diagram. This is offset from the position of FSS itself by the filmstrip border. A similar offset is there for loops and other structures.
From the offsets in position values (36,20) we can infer that the FSS border is 6 pixels wide and 10 pixels high.
The moral of the story is that if you want to predict the final location of the created object inside a structure you have to take the border size into account.
Thank you, i got the positioning ideology. However, two new questions arise immediately:
1. How the border size can be found for each type of structure? Different structures could have different borders. Even more, they could differ between LabVIEW versions.
2. How absolute position can be predicted for second or more frame of FFS? FlatSequenceFrame has no position property and Diagram inside is (as I understand) only a wrapper around own content.
I know multi-frame sequence is a bad style but they exist.
11-19-2019 11:48 AM
1. How the border size can be found for each type of structure? Different structures could have different borders. Even more, they could differ between LabVIEW versions.
Loops and FlatSequenceFrames have a ContentRect property, compare this to the MasterBoundsRect property of the structure to get the borders.
2. How absolute position can be predicted for second or more frame of FFS? FlatSequenceFrame has no position property and Diagram inside is (as I understand) only a wrapper around own content.
Again use the ContentRect property, the Top and Left values will give you the position.
11-20-2019 01:20 PM
Thank you Darin.K
Everything is clear for me now.
This in image illustrating difference between different types of structures. It could be useful for someone else who will meet the same problem
01-06-2023 01:44 PM - edited 01-06-2023 01:50 PM
Why is InPlaceElementStructure.Position=InPlaceElementStructure.Diagram.Position rather than (30,10) more?
Why is FlatSequenceFrame.Position=(0,0) versus (6,10) or FlatSequence.Position + (6,10)? It is senseless for FlatSequenceFrame.Position to be relative to itself.
If all Position properties are not in the same reference plane, how is it determined whether Position is relative to the Block Diagram or something else?
Why is FlatSequence.Position=TopLevelDiagram.Position when FlatSequence is not in the upper-left corner of the Block Diagram (either relative to the origin dot or to the visible scrolled location)?