GDL
About building parametric objects with GDL.

Call of object with nested call

GDL Enthusiast
Enthusiast

Hi,

 

If I CALL from a Master object, an secondary object that CALL's a third object, the bottom level object seems to revert to its original location. Does calling objects, with nested objects, reset lower level object variables?

 

I have never called three levels down but think it could be useful to create subassemblies that can be called at a higher level.

 

An example could be a bolt that CALL's a separately modelled nut object. The nut is offset in x,y,z dimensions to align with the bolt. The bolt is then CALLed into a baseplate object assembly.

 

The base plate CALLing the bolt subassembly object, results in the nut reverting to its original origin before all the bolt x,y,z offsets were applied. Do I have to pass down variables to the nut from the base plate i.e. call the bolt object but also position both the bolt and nut from within the baseplate CALL?

 

Is there a way to lock the x,y,z location of the subassembly called objects?

 

Many thanks, Matt

3 ACCEPTED SOLUTIONS
5 REPLIES 5
Solution
Barry Kelly
Moderator

The act of 'CALLing' an object will not alter its location.

You set the location (ADD, ROT) before you CALL the object.

It will then come in at that position, based on the called objects default settings.

If that called object has parameters that can affect its location, then you must provide the values for those parameters when you call it, (or it will just use the defaults saved in the called object).

 

If you are now calling an object that calls another object, you will need to control the values of the parameters in the third object in the first and second objects.

As well as setting the location you want to be before you call each object.

 

So, set location in first object.

Call second object passing on any parameter values that affect the location of the second object.

In the second object you set the location before you call the third object.

You also set the parameter values that may affect the settings of the third object.

You also have to set these values for the third object in the first object, as you call the second object so they can be passed on to the third.

 

Basically, you have to control the parameters of all of the called objects from the parent object - if they have parameters that affect their size/location.

 

I hope that makes sense.

It might only in my head.

 

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
Solution
Lingwisyer
Guru

And this means that you are ideally duplicating every parameter used by your Called objects into your parent object...  One of the many reasons why using GS macros is such a pain...

 

Wish: https://community.graphisoft.com/t5/Wishes/Object-Hierarchy-Calls-Parameter-Transfer/td-p/392798

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Solution

Hi Barry, 

 

Okay that makes sense: no matter how many levels of nesting, each nested object requires unique variables assigned from the Master level. All nested lower level Calls loose their lower level nesting variables when called from a higher level. That is a thing! Thank you so much for your help! Cheers Matt

Hi Lingwisyer, 

 

Thank you for responding, most appreciated! Best regards, Matt


@GDL Enthusiast wrote:

Okay that makes sense: no matter how many levels of nesting, each nested object requires unique variables assigned from the Master level. All nested lower level Calls loose their lower level nesting variables when called from a higher level. That is a thing! Thank you so much for your help! Cheers Matt


I am not quite sure what you mean by this, or if you understood what I was saying.

So let me try and clarify with your nut and bolt analogy.

 

You create a plate object that calls a bolt object.

That bolt object calls a nut object.

 

Your plate could call the bolt and nut separately, but let's go the nested macro route instead.

 

The plate calls the bolt, so it needs parameters that can control the bolt (length, diameter, head shape, etc).

These can be exactly the same parameters as those use in the bolt, but if you include them in the CALL command, you can control them as if you were placing the bolt itself (which you are, just as a macro rather than a separate object).

 

Now the bolt CALLs the nut, so again you can use the same parameters for the nut in the bolt as well, so you can control it.

 

Because the plate calls the bolt that calls the nut, if you want to control the nut in the plate, you will need all of the parameters for the nut in the plate object as well.

So the plate has all of the parameters you want to control for the bolt and the nut (as well as its own plate parameters), the bolt has the parameters for the nut (as wel as its own bolt parameters, and the nut just has the parameters to control itself.

 

Now where it can get a bit more complicated is if the plate calls bolts that are different sizes.

Then you need unique parameters to control each bolt size, shape, etc.

So, bolt_1_length, bolt_1_diam, bolt_2_length_2, bolt_2_diam, etc.

You call the same bolt macro (object) as many times as you need it, but pass on the different bolt parameters in each call.

 

CALL "bolt" PARAMETERS bolt length = bolt_1_length, bolt_diam = bolt_1_diam, ... etc.

ADD, ROT, etc.

CALL "bolt" PARAMETERS bolt length = bolt_2_length, bolt_diam = bolt_2_diam, ... etc.

Repeat for as many bolts as you need in your plate object.

 

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

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!