BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

X Y co-ordinates of the object

dhaval7shah
Newcomer
How can I get X-Y co-ordinates of an Object, through its own GDL script?
I also want to take the same data in to Schedules. Can anybody show me some example of such scripts.
(I tried with e.g. x1 = SYMB_POS_X , but i think i dont know how to use this Global parameter?)
Thanks.
Dhaval Shah
Upto AC 22
iMacs and MacBookPros: Mac OS X (10.6 to 10.12, Intel core 2 Quad to i5, i7, 8 GB to 16GB)
Win 10, AMD Opteron 6-Core x 2, 16GB, FirePro W4100 2GB
& ThinkPad E550
& i7, 8GB
9 REPLIES 9
alemanda
Advocate
In you gdl object you should define two parameters and assign to them the value of SYMB_POS_X and SYMB_POS_Y. Then you should add these two parameters as filter in your schedule.
Hope it is useful.
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
Anonymous
Not applicable
Hello,

If I remember right, the object's coordinates are always zero in the schedules


Regards, Juha
Barry Kelly
Moderator
Does this post about the GLOB_WORLD_ORIGO_OFFSET help?

http://archicad-talk.graphisoft.com/viewtopic.php?t=33878

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
dhaval7shah
Newcomer
!!!!! Master script Part !!!!!
----
If bUpdate then
Xx1 = SYMB_POS_X - Ooffsetx !X co-ord
Yy1 = SYMB_POS_Y - Ooffsety !Y co-ord
Endif

Parameters Xx1 = Xx1
Parameters Yy1 = Yy1

Xx1Last = Xx1
Yy1Last = Yy1

if bUpdate then
Xx1 = Xx1
Yy1 = Yy1
else
Xx1 = Xx1Last
Yy1 = Yy1Last
Endif
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
2D script part :

text2 0.2, (-r1+0.1), "x: "+ PreX + str ("%.2", Xx1*100)
text2 0.2, (-r1-0.05), "y: "+ PreY + str ("%.2", Yy1*100)

Text output comes correct But the taken parameters Xx1 & Yy1 in the schedule, are showing the valuae incorrect (i.e. it considers the value of 'SYMB_POS_X' and 'SYMB_POS_Y' as zero)

can anyone help on this please?
Dhaval Shah
Upto AC 22
iMacs and MacBookPros: Mac OS X (10.6 to 10.12, Intel core 2 Quad to i5, i7, 8 GB to 16GB)
Win 10, AMD Opteron 6-Core x 2, 16GB, FirePro W4100 2GB
& ThinkPad E550
& i7, 8GB
Anonymous
Not applicable
Juha wrote:
If I remember right, the object's coordinates are always zero in the schedules
True.
Curiously, they do show correctly in basic component lists.
GDL oddities. Don't know if this can help.
dhaval7shah
Newcomer
yes, in Lists the co-ordinates cam correct, but there is still a limitation, when i duplicate the objects, i need to refresh one of its parameter to get the Xx1 & yy1 refreshed into the list. Otherwise they show duplicate co-ordinates.

Also somehow i could manage to show this X_Y co-ord values into schedules, but then the text out put is having the problem.
Can we use the PUT function here? do you buddies know how to use it?
(by the way this exercise is to prepare a co-ord table for Setting out points)
Dhaval Shah
Upto AC 22
iMacs and MacBookPros: Mac OS X (10.6 to 10.12, Intel core 2 Quad to i5, i7, 8 GB to 16GB)
Win 10, AMD Opteron 6-Core x 2, 16GB, FirePro W4100 2GB
& ThinkPad E550
& i7, 8GB
Anonymous
Not applicable
As Juha said, I don't know a way to display x, y coords in schedules.
Basic component list is the only possibility I can see for the moment.

May be Karl or other folks could tell you more.

Just in case,
!!! ----- Master Script -----
	x = xOff + SYMB_POS_X + GLOB_WORLD_ORIGO_OFFSET_X 
	y = yOff + SYMB_POS_Y + GLOB_WORLD_ORIGO_OFFSET_Y 
	z = zOff + SYMB_POS_Z

!!! ----- Property Script -----
	component "X Location", x, 'm' 
	component "Y Location", y, 'm' 
	component "Z Location", z, 'm'
No need to declare x, y, z as parameters., x, y will return 0.
dhaval7shah
Newcomer
Olivier wrote:
!!! ----- Master Script -----
	x = xOff + SYMB_POS_X + GLOB_WORLD_ORIGO_OFFSET_X 
	y = yOff + SYMB_POS_Y + GLOB_WORLD_ORIGO_OFFSET_Y 
	z = zOff + SYMB_POS_Z

!!! ----- Property Script -----
	component "X Location", x, 'm' 
	component "Y Location", y, 'm' 
	component "Z Location", z, 'm'
Thanks Olivier. Do i need to define these components in database too ? and then add them in the 'components' window ?
Dhaval Shah
Upto AC 22
iMacs and MacBookPros: Mac OS X (10.6 to 10.12, Intel core 2 Quad to i5, i7, 8 GB to 16GB)
Win 10, AMD Opteron 6-Core x 2, 16GB, FirePro W4100 2GB
& ThinkPad E550
& i7, 8GB
Anonymous
Not applicable
Not needed.
Document > Shedules and Lists > Component Lists > Basic. That's all.
Export under the format you need.

To separate different objects, you can sort them by ID, for eg.
!!! ----- Property Script -----
	component GLOB_ID + " X Location", x, 'm' 
	! etc...
Learn and get certified!