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

Graphical hotspots, macros & arrays

Anonymous
Not applicable
After emailing with Frank Beister, he told me: "This is worse for a thread on the Talk"
So, here is the thread.

I never succeeded to use macros with graphical hotspots into a main object using arrays.
Each time, i have to rewrite the complete list of graphical hotspots into the main object.
Frustrating.

My secret hope was it should be a way to do this, but Frank broke my dreams.
Frank, i am afraid you will have to do the job twice, and to explain why this is not possible.
Thanks anyway.
14 REPLIES 14
Oleg
Expert
F. wrote:
Fascinating, that the array dimension of lenT, set in the macros parameter list, does not matter if it's called. The lenTidx can become e.g. 4 and the usage of lenTidx[4] would cause outside the makro-context an error. But because obvisiously the definition of lenT in the main object has a higher priority it's allowed.
Yes you can pass array parameter of any dimension to a macro independent macro's default dimension even if 'a caller' object has no such parameter.
It is more general feature out of the subject. IMHO the reason is not a priority but that array parameters are _dynamic_ arrays now.

It is very interesting feature irrespective of macros and hotspots.
We can increase an array size by an object itself ( instead of defining a big oversized array like earlier )

PARAMETERS array_param [idx] = some_value
If idx more than current array dimension it will be increased.

PARAMETERS array_param = other_array
The whole array will assigned. Other_array will not be necessarily parameter or has same size as array_param.
Anonymous
Not applicable
F. wrote:
@Oliver
The objects I sent you Tuesday night didn't work, because there have been defined several moveable hotspots by calling the macro more than once. If you call the macro just one time it works for not-arrays too. See my modified and reduced example attached.
Hi Frank,

I had to rebuild your object (still on 8.1) but hapilly this is fast.
Yes i understand what you mean. It works just for one param once.

As i told you, i get similar results when i call for example, a window panel macro, with a graphical hotspot for angle opening.
The only condition, as you know, is to create the same param into the main object, and then the hotspot works.

The problem was to make it working with arrays, and i really thought it was not possible.
Thank you both for your help.

I will get a try with Oleg's solution, for an existing object, and see what happens.
Even if i have to create some additional params, i think this can save a lot of scripting lines,
and avoid to make the work twice, because my macros already have graphical hotspots.
Unfortunatelly, until now, i had to neutralize this part of script, and rewrite it into the main object. Tedious.

The important point, i think, will be to pay attention to the first uid for each macro. But it should work.
Thanks again.
Anonymous
Not applicable
Oleg wrote:
Yes you can pass array parameter of any dimension to a macro independent macro's default dimension even if 'a caller' object has no such parameter.
It is more general feature out of the subject. IMHO the reason is not a priority but that array parameters are _dynamic_ arrays now.

It is very interesting feature irrespective of macros and hotspots.
We can increase an array size by an object itself ( instead of defining a big oversized array like earlier )

PARAMETERS array_param [idx] = some_value
If idx more than current array dimension it will be increased.

PARAMETERS array_param = other_array
The whole array will assigned. Other_array will not be necessarily parameter or has same size as array_param.
Hi Oleg,

You should write more often.
If you have other info like this one, please, do not hesitate.
Very interesting.
Frank Beister
Moderator
As I have told once (or twice 😉 ) I am not so amazed by the dynamic arrays, because the can cause memory trouble, if the objects are not well written and increase array size too much.

But I can't say, that these dynamic arrays are bringinging some easy programming.

E.g. The REQUEST ("Story_info",... does not need an variable for each story settings you want to request It's just enough to use one dynamic array. All story infos are afterwards stored in the array. I think there are some more examples.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
The funny thing, is that when i read again the documentation (yes i do),
everything is there, but i never understood this part, due to hermetic language for me.

Curiously, just with Oleg's real and short example, all is clear. Despite the barrier of language for both.

I would like more real examples in the documentation, instead of some portions of code, outside of any real context.
That means, beside the pdf documentation, a folder containing hundred of gsm objects, using each GDL tool or feature.

GDL is compact, so these examples (8 or 10 Ko each), should not be a problem for disk space.
Just an idea.