Design forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Label position based on it's parameter.

Eshanta
Contributor

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.

4 REPLIES 4

Lingwisyer
Rockstar

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
Self-taught, bend it till it breaks.

Win10 | E5620 x 2 | 24GB | K2200 RIP PSU
Win10 | R5 2600 | 16GB | GTX1660

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.

 

Barry Kelly
Moderator

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.

 

BarryKelly_0-1652433560834.png

 

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.


One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

DGSketcher
Rockstar

@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.  

Apple iMac macOS Monterey / AC25UKI (most recent builds)

Didn't find the answer? Start a new discussion

Labels

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!