Delete an item from a Parameter Array

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-24 07:03 AM
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.

Solved! Go to Solution.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 05:54 PM
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
here is the script (
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-24 08:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-24 10:56 AM


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-24 11:31 AM
You can write the Values of the 1st Arrayparameter in a second one, then delete the 1st Arrays values and rewrite the 1st Array from the 2nd one by leaving a special value.
You can delete the Values of an Array Parameter by using something like this:
IF x THEN
DIM s[1][1]
PARAMETERS c = s
ENDIF
where c is your Array Parameter
GDL object creation: b-prisma.de

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-25 02:04 AM
Thank you for your reply.
Well I have just tried out your trick and it didn't workout and I can't get why it doesn't !!
It's as is it refuses to just delete the array parameter (


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-25 02:07 AM
I also tried to use the script in the Master Script, and it just doesn't delete that item.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-25 02:22 AM
!j1: Wall !j2: Beam !j3: Column !j4: Handrail !j5: Other _profile_types = 0 if bEnableWall then _profile_types = _profile_types + 1 if bEnableBeam then _profile_types = _profile_types + 2 if bEnableColumn then _profile_types = _profile_types + 4 if bEnableRail then _profile_types = _profile_types + 8 if bEnableOther then _profile_types = _profile_types + 16 VALUES "myProfileIdx" PROFILETYPES_MASK _profile_types
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-25 02:41 AM
I don't get it !!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-25 03:01 AM
if GLOB_UI_BUTTON_ID > 1000000 then n = APPLICATION_QUERY ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", _isFirstRun) !<-- prevents unnecessary consecutive entries if _isFirstRun then dim _ap_openingLintel[][], _ap_openingLintelHieght[][], !<-- create dummy containers _ap_openingsX[][], _ap_openingsY[][], _ap_openingSizeX[][], _ap_openingSizeY[][] parameters _delItem = (GLOB_UI_BUTTON_ID - 1000000), !<-- Index of the desired opening to delete _count = 1 for _i = 2 to vardim1(ap_openingLintel) step 1 if _i # _delItem then parameters _ap_openingLintel[_i][1] = ap_openingLintel[_count][1], _ap_openingLintelHieght[_i][1] = ap_openingLintelHieght[_count][1], _ap_openingsX[_i][1] = ap_openingsX[_count][1], _ap_openingsY[_i][1] = ap_openingsY[_count][1], _ap_openingSizeX[_i][1] = ap_openingSizeX[_count][1], _ap_openingSizeY[_i][1] = ap_openingSizeY[_count][1], _count = _count + 1 endif next _i parameters ap_openingLintel = "", ap_openingLintelHieght = 0, ap_openingsX = 0, ap_openingsY = 0, ap_openingSizeX = 0, ap_openingSizeY = 0 endif endif
Well that is the code I have put in the "Parameter Script", and although I´m sure that GLOB_UI_BUTTON_ID > 1000000 works fine, the parameters (


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-28 04:16 PM
