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

Relations betwwen gsm objects

Cosminn
Contributor
Hello everyone

Is there a way for an object to read parameters from other object from the floor plan?

In other words,

For example let's say I have 2 objects, we call them:

Object_1 and object_2.

Object_1 has a parameter.
Parameter name is param_1, and parameter type is, let's say -length-.
As a default value we can set 1.50.

Object_2 has a parameter as well.
Parameter name is param_2 and the type is also -length-

We place both objects on the floor plan.
And my question is:

Can I create a new parameter in object_2, who can always read the value of param_1 from object_1?

My english level is quite poor, so I really hope you'll understand what I've wrote.

Thank you.
Sincerely,
Daniel
16 REPLIES 16
Cosminn
Contributor
Indeed Barry,

Works properly. I really liked. This will save many problems and also time.

What if I have 2 or more Objects_1 and one objects_2. Will be possible to read from all of them? If yes, what is the condition?

Thank you
Sincerely,
Daniel
Barry Kelly
Moderator
Unfortunately you can only have one object_1.
You can have as many object_2 as you want but they will all follow the parameters of object_1

This is where the GLOB_USER variables will be very restrictive because there are only 10 numeric variables available (and another 10 string variables which I think can be used for numbers as well).

You will have a similar problem with the text output although you will have much better control of what you can output to and read from the file.

You could add some control to object_1 to say output to variables 1,2 & 3 or variables 4, 5 & 6 (7,8 & 9 etc.) - assuming you are controlling 3 variables - it could be any number.
i.e. add a parameter to say use variables 'group 1' or 'group 2' or 'group 3' etc.
The object_2 you can tell it to read 'group 1' or 'group 2' or 'group 3' etc.

But I really think you could get into a terrible mess - especially if you want other people to use your objects.


If you only have one object_1 then it is pretty straight forward as you can have as many object_2 as you want react to it.
More difficult if you have more object_1 as they need to output to different variables and then you have to tell each object_2 which variables to read.

I hope I have explained this clearly enough (it has been a long day).

If you want more than one object_1 then I probably would not try this with GDL.
Maybe it will work with an API add-on if you can create a link between objects but I don't know as I have no idea about coding add-ons.

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
Cosminn
Contributor
Your information was very helpful Barry.

Thank you so much.
Sincerely,
Daniel
Cosminn
Contributor
@Barry :
You said :
"Yes it can be done in GDL with a text file as an intermediate link.
But the object must be visible on screen to write to or read from the text file."

If you'll have time to write a sample script for this, or maybe you can let me know which part from the guide should I looking for this, will help a lot.

Anyway, a Script is a Script

Thank you for your time

Regards,

Daniel
Sincerely,
Daniel
Barry Kelly
Moderator
Try this.

You can still only have one 'object_1' in you plan otherwise you will have multiple objects trying to write different information to the same text file.

You can have as many 'object_2' as you want and they will all change when you alter object one on screen.
You must do a 'Rebuild and Regenerate' command (CTRL+ALT+SHIFT+R) if you change object_1 in plan.
If you do it in 3D window then it should all be live.

I have set the objects so they will create and read from an '.XLS' file that has the same name as your Archicad file but with the added name of '_object_sizes.xls'
It will be located in the same folder as your Archicad file.

I assume it will work if you are using a MAC - but I am not 100% sure.


Forget what I said before about using GLOB_USER variables.
Graphisoft have discontinued their use from version 19 so they will be completely useless.


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
Cosminn
Contributor
Thank you so much.
I'll try it.
Seems to be exactly what I need. Those Global Variables was worked properly. But I need to try this as well. What I need is:
5-10 Objects to read from One object, this can be an assembly.
And I need few assemblies like this in on project. @40 assemblies.
Do you think will work? I mean will make the project process harder?

Again Thank you!!!
Sincerely,
Daniel
Barry Kelly
Moderator
I would forget the GLOB_USER variables.
That will only work up to version 18.
From 19 onwards they will no longer work.

I am not sure exactly what you are trying to do but it should work.
If you have got 40 assemblies then you will need 40 master objects ('object_1' but of course with unique names).
Each one of those objects will need to write to a unique text file - that is where you can customise the file name in the file path.

Otherwise you could write to just the one text file but you would need unique names for the fields being written and read.
i.e. master_1 would have to save 'length_1', 'width_1' and 'height_1'.
master_2 would have to save 'length_2', 'width_2' and 'height_2'
master_3 would have to save 'length_3', 'width_3' and 'height_3'
etc.

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