Copy Parameters to another parameters
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-11-03 09:52 AM
2015-11-03
09:52 AM
I wonder how I could copy my Parameter "Article_no" to "FM_SerialNumber"
And I wish to have same information in Both even if I fill in "FM_SerialNumber" it should effekt "Article_no".
I know this is not the way, and this is not the way...

Article_no = FM_SerialNumber FM_SerialNumber = Article_noDo anyone understands what I want?

6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-11-03 10:25 AM
2015-11-03
10:25 AM
How about ...
if GLOB_MODPAR_NAME = "Article_no" then FM_SerialNumber = Article_no PARAMETERS FM_SerialNumber = FM_SerialNumber endif if GLOB_MODPAR_NAME = "FM_SerialNumber" then Article_no = FM_SerialNumber PARAMETERS Article_no = Article_no endifBarry.
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
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
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-11-03 10:35 AM
2015-11-03
10:35 AM
Barry wrote:Well Barry I could hug you right now! Thanks alot!
How about ...
if GLOB_MODPAR_NAME = "Article_no" then FM_SerialNumber = Article_no PARAMETERS FM_SerialNumber = FM_SerialNumber endif if GLOB_MODPAR_NAME = "FM_SerialNumber" then Article_no = FM_SerialNumber PARAMETERS Article_no = Article_no endifBarry.
What should I read to become a master of GLD?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-11-03 11:14 AM
2015-11-03
11:14 AM
It' better to use it in the following form:
To read more about GDL, you should check GDL Center at gdl.graphisoft.com.
if GLOB_MODPAR_NAME = "param1" then param2 = param1 parameters param2 = param2 else param1 = param2 parameters param1 = param1 endifThis method forces the linking of parameters - if any other parameters changed by another function or addon.
To read more about GDL, you should check GDL Center at gdl.graphisoft.com.
_________________
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-11-04 02:44 AM
2015-11-04
02:44 AM
Gergely wrote:
It' better to use it in the following form:
if GLOB_MODPAR_NAME = "param1" then param2 = param1 parameters param2 = param2 else param1 = param2 parameters param1 = param1 endifThis method forces the linking of parameters - if any other parameters changed by another function or addon.
Is this really better?
This would mean if I adjust param3, param4, param5, etc., then param1 is always going to be forced to equal param2 (which it should already be).
Params 3, 4, 5, etc., probably have nothing to do with the other two so why make the script perform more computations than it needs to every time any parameter is changed?
I know we are talking nano-seconds in computing time but is there really a need to do it?
As for learning GDL the reference manual (and now GDL Centre) are fine ut lack examples.
I still find the GDL Cookbook by David Nicholson-Cole is quite good - although a little out-dated now.
It explains things quite well and has example objects you can make.
Google it or search in this forum for links.
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-11-04 09:19 AM
2015-11-04
09:19 AM
Barry,
I think that the "if GLOB_MODPAR_NAME then ... else ... endif" method is much better, as in my mind the most important role of parameter script is to keep the consistency between an objects parameters. Without forcing parameter linking, you can have problems with changing parameters with multiple selection or parameter transfer.
About the speed I don't think that my method is slower than yours, as in your solution there is always 2 string comparisons in the 2 "if GLOB_MODPAR_NAME ..." lines - and string comparisons are a quite slow thing in any programming languages.
If you have any questions about a specific topic, please send your requests to us via the GDL center's forum or by mail - we try to answer as many problems as possible in the Tips&Tricks section of the site.
I think that the "if GLOB_MODPAR_NAME then ... else ... endif" method is much better, as in my mind the most important role of parameter script is to keep the consistency between an objects parameters. Without forcing parameter linking, you can have problems with changing parameters with multiple selection or parameter transfer.
About the speed I don't think that my method is slower than yours, as in your solution there is always 2 string comparisons in the 2 "if GLOB_MODPAR_NAME ..." lines - and string comparisons are a quite slow thing in any programming languages.
If you have any questions about a specific topic, please send your requests to us via the GDL center's forum or by mail - we try to answer as many problems as possible in the Tips&Tricks section of the site.
_________________
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-06-07 08:24 AM
2017-06-07
08:24 AM
Barry wrote:Hi to all,Gergely wrote:
It' better to use it in the following form:
if GLOB_MODPAR_NAME = "param1" then param2 = param1 parameters param2 = param2 else param1 = param2 parameters param1 = param1 endifThis method forces the linking of parameters - if any other parameters changed by another function or addon.
First I want to thank everyone here, without you I wouldn't have grasped the GLOB_MODPAR_NAME
Second, for the people who will ask theirselves how to apply the same idea for more than 2 parameters, just follow the same block and repeat for every parameter you want to link
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.
