Object placement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-16 10:37 AM
I'm new to GDL scripting. Is it posible to make an object which finds other object from project and places itself in to it?
How could i get position from f.e. column wher to place GDL object ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-16 11:03 AM
first answer = No.
Each object sees only itself.
You can't code a chair to sense a table and put itself in position.
(But you can always code a special table and part of its code will be the chair near it.)
In other cases, if you code a door, for example, it will be positionable only on walls so second answer is "perhaps"


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-16 11:16 AM
New wrote:Objects can't recognise other objects or elements in your model.
I'm new to GDL scripting. Is it posible to make an object which finds other object from project and places itself in to it?
However one object can 'CALL' another object.
This can be automatic (i.e. will happen every time) or you can add a Boolean (on/off) parameter to you object that allows you to manually call the second object.
New wrote:You can add hotspots to you object and use these as anchor points for placing a set distance from your column.
How could i get position from f.e. column wher to place GDL object ?
The hotspot distance can be adjustable via a parameter in you object if you need an adjustable distance.
If you are new to GDL scripting then try googling 'GDL Cookbook'.
This is probably the best source for learning GDL scripting - even if it is a bit old now.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-16 11:56 AM
I do Appreciate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-18 09:42 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-19 03:55 AM
hfs55 wrote:I can't give a good example with the standard Graphisoft library object as I don't use them.
Cadimage's electrical object reacts to adjacent walls, but is an addon. Didn't know one object could call another.. Is there an example of that somewhere Barry?
But theire windows for example call in the frames, panels and sills - although these may not be items you can place individually.
But and example I can show you is my gable object.
I have a separate barge and finial objects that I can use on their own if needed but I simply CALL them into my gable object so I don't have to script them all over again.
When you call an object (or macro - generally this is a non place-able object or it could just be a series of instructions for determining brick coursing size for example) you can give it all the parameter values you need to make do just exactly what you want it to do.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-19 11:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-30 10:21 AM
Maybe using GV, req, maybe macros.
I understand that with call i can only draw one or another object into each other, right? That way both objects would be like 1. hmmm...
Found it usefull in some cases, but the main problem is that i need to get data from project about object location and few other parameters, maybe export them to .txt file?
I belive addon would be right aproch but haven't been able to find soloution yet. Curently looking into Geometry functions and APINeig trying to figure out how do they work and if they can be usefull for my project.
Finding soloution in GDL scripting would be better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-02-05 07:17 AM
Using Global variables got object to some or another way to communicate with archicad project. But when i move object with script it doesn't move where i want and also symb_pos of and object doesn't move and weirdly move further away.
I guess Glob_user variable aren't really reliable. Is there a way to move symb_pos with scripts ? Coudln't get it to move.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-02-05 08:39 AM
SYM_POS with give you the co-ordinates of your object global origin in relation to the model origin.
You can not use these to move you object - that has to be done with the ADD command.
Movement commands (i.e. ADD, MUL, ROT) will have no effect on the SYM_POS values
You could have one object write the SYM_POS values to GLOB_USER variables or to an external text file.
You could then have second object read in those variables and use the ADD commands to move the object away from the Global Origin by that distance.
But you would always have to place the second object exactly on the Drawing Origin for it to work (at least I think it will - haven't tested to be sure).
The other problem you will have with GLOB_USER variables is that there is only a limited number of them.
So SYM_POS_X, _Y & _Z will use up 3 of them.
If you want more than one object reliant on the position of another you will fast run into trouble.
Text files may be better but I am sure they will still have their problems.
The second object you place will always be reliant on the first object being there and having written values to GLOB_USER or text file.
Possibly depending on where you script the saving of values in the first object will affect whether they get written or not (i.e. is the parameter or master script being run?).
Again I am only speculating as I don't know what you are trying to do.
If I need a second object to be reliant on the position of the first then I will just do a simple CALL statement in the first object and position the second object where it needs to go with ADD & ROT commands.
You can even add a Boolean (On/Off) switch to the first object to say if you want the second to show or not.
You could place as many of these objects as you like in your model and the would all work independent to each other - they will not all be trying to use the same GLOB_USER variables.
I hope this makes sense.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11