Back

Topic

[KB1122]Automatically position symbols with the Application Architect

Tags: AA, Application Architect, Graphics

3 years ago
By FABO
Options
Print
Applies to:

PcVue 12.0 onwards


Summary: 

Using expressions in the Application Architect allows you to automatically position symbols in a mimic. There are several ways to achieve this, we propose here a library to facilitate the implementation of such expressions.


Details:

This library is named L_Graphic, it has 9 parameters. 2 of them have to be used to define the X and Y position of your symbol. The others have to be placed and configured in the template which contains the symbol.

To integrate this library into your project, you will have to :
1/ Create a LIB directory in your project if it doesn’t already exist.
2/ Paste in this LIB directory the library downloadable in this article.
3/ In the Application Explorer, add an existing library by selecting the L_Graphic library:

L Graphic library

The attached project sample (AA_Symbols.zip) is using this library to set the position of 50 solar panels on the roof of a building:

Solar panels overview

Here is the configuration in the Application Architect, on Templates tab:

Solar panels template

And the instanciation:

Solar panels Instances

Everything is explained in the Documentation tab of the Readme template in this library:

Solar panels template Documentation
 

In expressions, you will find the following operators:

  • % means “modulus”
  • != means Inequality
  • strRight(str1,num1) means The rightmost num1 characters of the string str1
  • Truncate(num1) means Integer part of num1

Here are the calculations made for the positioning parameters:

  • X_SymbolPosition: =(Params(“L_Graphic/IndexShift”) + StrRight(Parent.Name, Params(“L_Graphic/IndexDigitsNumber”))) % Params(“L_Graphic/ColumnsNumber”) * Params(“L_Graphic/SymbolWidth”) + Params(“L_Graphic/X_OriginPosition”)
  • Y_SymbolPosition: =Truncate((Params(“L_Graphic/IndexShift”) + (StrRight(Parent.Name, Params(“L_Graphic/IndexDigitsNumber”)))) / Params(“L_Graphic/ColumnsNumber”)) * Params(“L_Graphic/SymbolHeight”) + Params(“L_Graphic/Y_OriginPosition”)
Download attachments: 

 

 

 
 
 
 

Created on: 28 Jul 2021 Last update: 30 May 2024