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

Suggestion to Improve GLOB_MODPAR_NAME

Nader Belal
Mentor
Hi there,

GLOB_MODPAR_NAME is a GDL function that permits the scriptor to update the values of certain parameters if certain conditions are met in the parameters script.

example:
if GLOB_MODPAR_NAME = "paramName" then
*** do something ***
endif
it's strength relies in its ability to create a circular condition between parameters, but it could become tedious task for the scriptor to use this functions repeatedly a big number of parameters.

Therefore, I propose the following
That if GLOB_MODPAR_NAME is referencing a parameter title (in Parameters tab), then the condition is applied to all parameters that are under the parameter Title
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
7 REPLIES 7
Barry Kelly
Moderator
But a title is not a parameter that a user can edit.

Besides, if under a title (and you would have to link the following parameters other wise it is just a title on its own), what happens when you have boolean, text, length an other parameter types.
Your "do something" won't be able to affect all of them in the same way.

So your suggestion would only be able to work if all parameters grouped to your title were of the same type.
And even then would you really want to do the same "something" to them all - I can't think of an example where it would be handy.

I would say it is much easier and clearer to just tell each parameter what to do.

If you have a more specific example, then maybe I could understand it better.

Barry.
One of the forum moderators.
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
Lingwisyer
Guru
I would not mind having a "vice versa" sub-function to use with this that would inverse the operation. Rather than essentially duplicating the lines. Edit A, B & C change. Edit B, A & C change. etc.


Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Nader Belal
Mentor
@Barry Kelly

The idea is that if "GLOB_MODPAR_NAME" have detected a change in any parameter value under the title, you would specifiy what parameters should be changed. So basically you have made the code less verbose.

@Lingwisyer

I have found a method (based by mixing ideas that are already found on various locations including here) that may work for your requirements in your case and quiet easy to implement. so if you like, we may arrange an online meeting were I will show you my trick and you will show me yours.

For both,

Although what I have just said to @Lingwisyer may seem as a contradiction to my suggestion, but I have seen cases were objects that are linked to an ARchiCAD, need a lot of changes, but at the same time needed to conserve some of the old parameters, so that the office template wouldn't break.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Barry Kelly
Moderator
Moonlight wrote:
@Barry Kelly

The idea is that if "GLOB_MODPAR_NAME" have detected a change in any parameter value under the title, you would specifiy what parameters should be changed. So basically you have made the code less verbose.
I am still not seeing the benefit here.
In your first post you say it the title parameter is amended (which is not possible), that 'all' linked parameters will be amended (I am not sure how if they are all different parameters).

Now you clarify that if one parameter under a title parameter is changed "you would specifiy what parameters should be changed"

Isn't this the same as ...

if GLOB_MODPAR_NAME = "parameter_1" then
parameter _2 = .....
parameter _3 = .....
parameter _4 = .....
PARAMETERS parameter _2 = parameter _2, parameter _3 = parameter _3, parameter _4 = parameter _4
endif

I don't see how you could say...

if GLOB_MODPAR_NAME = "parameter_1" then
ALL linked parameter in that group = ....
PARAMETERS ALL linked parameter in that group = ALL linked parameter in that group
endif

Then if only some of the parameter should change then as you say "you would specifiy what parameters should be changed".
Which mean you are going to have to list the ones you want to change anyway.


I commend you for thinking outside the box, but as I said I will need to see a practical example of how this would work to understand it better.
I can't imagine a group of parameters that would all need to be changed in the same way if another parameter is altered (with the exception of maybe swapping all surface materials to become the same).
And if they are it is only one line of code to change each of those parameters and then one extra to set them.

Barry.
One of the forum moderators.
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
Nader Belal
Mentor
@Barry Kelly

May be I have expressed myself in the wrong way....

My suggestion is (by example):

if GLOB_MODPAR_NAME = Parameter Title then
parameters \
param_01 = ....
param_02 = ....
param_03 = ....
endif

I know that parameter title is not linked to all parameters that are in its group, and that is why I'm asking for it.

By the way, if I was scripting my own object, by my own way , not reliant on any other previous settings that was put in place that I can't change, then there is a 95% chance that I wouldn't have used "GLOB_MODPAR_NAME", not because I don't know how to use it, but because most of my programming schemas that I design made/makes/would make "GLOB_MODPAR_NAME" almost irrelevant.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Barry Kelly
Moderator
So my question now is, how does a user modify a title?
What are they updating as it is has no values to change as you are aware?

You can do it now if you change your title to a boolean and make it BOLD.
It still looks just like a title and you can link the other parameters under it.
And now it is editable so you can trap it with GLOB_MODPAR_NAME.


"This is a regular tiltle" ? - I will learn to spell one day!


Also being a boolean, you can have it reset automatically to off as soon as the user ticks it.
I do this to update a timestamp object that I have.
if update_swch_1 = 1 then
	x = REQUEST("DateTime","%d %b %Y",dstr)
	x = REQUEST("DateTime","%X",tstr)
	PARAMETERS date = dstr + " " + tstr
	PARAMETERS update_swch_1 = 0
ENDIF


So I guess what you are asking for is for a title to have a boolean option so it looks like a title but have a value that can be changed so that you can trap it.
Or give the other parameter type the option to look like a tile (all caps with backgound colour).
Just noticed if you link other parameters the first parameter does get the background fill.
If there are no links then it does not have the background fill.


And I don't see your code becoming any less verbose.
You are still saying if this parameter is changed, then change this one and this one and this one.
Exactly as it is now?


Barry.
One of the forum moderators.
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
Nader Belal
Mentor
@barry kelly

I understand your point of view, but from my perspective what I'm trying to say in psuedo code is this:

if any parameter under a certain title parameter have changed --> then change those parameters.

that's why I was suggesting a new version of GLOD_MODPAR_NAME, because that way, you may rearrange parameters under certain titles, and it would be easier even to create circular values.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

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!