We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Delete an item from a Parameter Array

Nader Belal
Mentor
Hello everyone,

If I have a Parameter array that is filled with different values, but I need to delete one specific item in the middle, how should this problem be handled using GDL ??

PS: I´m not talking about a variable array.
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.
10 REPLIES 10
Solution
Nader Belal
Mentor
To everyone,

First I want to thank you all for all the help, especially to my friends Carlos Lopez Figueroa from Mexico for putting me on the right track, and Shawn Hopkins.

Second, the right way (in my case) to do update/delete array parameters is using this simple code that was posted in this thread https://archicad-talk.graphisoft.com/viewtopic.php?t=30992&start=30 (special thanks to Braza from Portugal, see attachment )

here is the script (adapted to Graphisoft Style recommendations😞
dim setval[]
for i = 1 to n

	if i > vardim1(val) then
		setval = 0
	else
		setval=val
	endif
next i

val = setval

parameters val = val

Third the most important part, Why the hell my past code did not update my arrays !!!


Well it happens that this line script in the Parameter Script tab did give me all the trouble:

n = APPLICATION_QUERY ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", _isFirstRun)
It appears to be that this past line was preventing the arrays from being updated, and to by pass any issue that may result from consecutive value deletion you have to put a time stamp, as have been explained in other threads in this forum.

I will put this finding as an issue for Graphisoft Team.

Thank you all
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.