We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-05-13 10:32 AM - last edited on 2023-05-31 10:13 AM by Laszlo Simon
I am trying to create a label which changes it's position based on the co-ordinate values (global) defined in it's parameter.
For example, if the label is in a random position with initial parameters:
Global_X=1
Global_Y=2
and I change it to Global_X=3, Global Y=5, the label should move to global (3,5).
The initial position of the label does not matter i.e. when the user clicks on the element, the label can be placed anywhere but it has to move based on the global coordinates defined within it's parameters.
Can this be achieved ?
If it can, which command would help me achieve it ?
Thank you.
2022-05-13 10:50 AM - edited 2022-05-13 10:57 AM
As far as I know, the only thing in GDL that can reference the Global Origin are textures through the COOR commands. If there is anything, you might be able to find it in the Survey Point object.
Correction: for 2D, you can use the globals Symbol_Pos_X and Symbol_Pos_Y. which will give you the objects relative position from the origin.
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2022-05-13 11:02 AM
Thank you very much for your reply.
I have already tried that and I get 0 no matter what.
I just tried it in a simple way as follows:
TEXT2 0, 0, SYMB_POS_X
Regardless of where I click, I always get zero.
2022-05-13 11:28 AM
I'm not quite sure what you are trying to do, but as far as I know, the label position is stored in a GLOBAL variable.
This is from the GDL manual.
It is a 3x2 array of the x & y coordinates of the leader arrow.
If you don't have the leader line on, I think it just uses the x & y coordinates of the first array value.
You should see those variables used to position the text in your label, so I am guessing you could manipulate those values.
i.e add values to them or simply use your own instead of those.
Barry.
2022-05-14 11:32 AM
@Eshanta It does depend on what you are trying to do as to how you process the data points mentioned by @Barry Kelly. I have created labels that use parameters to position the text relative to the click / insertion point but the leader line on/off value will disrupt can disrupt what you are trying to achieve. Look at some of the GS label library objects to see if they help. The SYMB_POS_X & Y values and the data points will be important references in your GDL coding.