<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Delete an item from a Parameter Array in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278941#M3095</link>
    <description>To everyone,&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Second, the right way (in my case) to do update/delete array parameters is using this simple code that was posted in this thread &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?t=30992&amp;amp;start=30" target="_blank"&gt;&lt;LINK_TEXT text="viewtopic.php?t=30992&amp;amp;start=30"&gt;https://archicad-talk.graphisoft.com/viewtopic.php?t=30992&amp;amp;start=30&lt;/LINK_TEXT&gt;&lt;/A&gt; (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;special thanks to Braza from Portugal, see attachment &lt;E&gt;&lt;/E&gt;)&lt;BR /&gt;
&lt;BR /&gt;
here is the script (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;adapted to Graphisoft Style recommendations&lt;E&gt;&lt;/E&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;

&lt;PRE&gt;dim setval[]
for i = 1 to n

	if i &amp;gt; vardim1(val) then
		setval&lt;I&gt; = 0
	else
		setval&lt;I&gt;=val&lt;I&gt;
	endif
next i

val = setval

parameters val = val&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
&lt;B&gt;&lt;FONT size="150"&gt;&lt;FONT color="#FF0000"&gt;&lt;BR /&gt;
Third the most important part, Why the hell my past code did not update my arrays !!!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Well it happens that this line script in the Parameter Script tab did give me all the trouble:&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;n = APPLICATION_QUERY ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", _isFirstRun)
&lt;/PRE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
I will put this finding as an issue for Graphisoft Team.&lt;BR /&gt;
&lt;BR /&gt;
Thank you all</description>
    <pubDate>Tue, 29 Jan 2019 16:54:42 GMT</pubDate>
    <dc:creator>Nader Belal</dc:creator>
    <dc:date>2019-01-29T16:54:42Z</dc:date>
    <item>
      <title>Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278931#M3085</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hello everyone,&lt;BR /&gt;
&lt;BR /&gt;
If I have a Parameter array that is filled with different values, but I need to delete one specific item in the middle,&lt;B&gt; how should this problem be handled using GDL&lt;/B&gt; ??&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;PS:&lt;/B&gt; I´m not talking about a variable array.&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Jan 2019 06:03:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278931#M3085</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-24T06:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278932#M3086</link>
      <description>the code you need is in the polyline object that floats around here.  its made for infinite but the code will work for you with minor adjustments</description>
      <pubDate>Thu, 24 Jan 2019 07:58:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278932#M3086</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2019-01-24T07:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278933#M3087</link>
      <description>Can you be more specific, cause I found many of them and couldn't pin point which one.</description>
      <pubDate>Thu, 24 Jan 2019 09:56:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278933#M3087</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-24T09:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278934#M3088</link>
      <description>I am not shure, if this works:&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
You can delete the Values of an Array Parameter by using something like this:&lt;BR /&gt;
IF x THEN &lt;BR /&gt;
	DIM s[1][1]&lt;BR /&gt;
	PARAMETERS c = s&lt;BR /&gt;
ENDIF&lt;BR /&gt;
where c is your Array Parameter</description>
      <pubDate>Thu, 24 Jan 2019 10:31:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278934#M3088</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2019-01-24T10:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278935#M3089</link>
      <description>@ Joachim Suehlo &lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
&lt;BR /&gt;
Well I have just tried out your trick and it didn't workout and I can't get why it doesn't !!&lt;BR /&gt;
&lt;BR /&gt;
It's as is it refuses to just delete the array parameter (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;&lt;FONT color="#FF0040"&gt;I repeat, a parameter and not a variable&lt;/FONT&gt;&lt;E&gt;&lt;/E&gt;)</description>
      <pubDate>Fri, 25 Jan 2019 01:04:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278935#M3089</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-25T01:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278936#M3090</link>
      <description>@Joachim Suehlo &lt;BR /&gt;
&lt;BR /&gt;
I also tried to use the script in the &lt;B&gt;Master Script&lt;/B&gt;, and it just doesn't delete that item.</description>
      <pubDate>Fri, 25 Jan 2019 01:07:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278936#M3090</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-25T01:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278937#M3091</link>
      <description>Can value masking be done outside of &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Complex Profiles&lt;E&gt;&lt;/E&gt;?&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;!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
&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Fri, 25 Jan 2019 01:22:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278937#M3091</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-25T01:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278938#M3092</link>
      <description>@ling&lt;BR /&gt;
&lt;BR /&gt;
I don't get it !!</description>
      <pubDate>Fri, 25 Jan 2019 01:41:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278938#M3092</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-25T01:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278939#M3093</link>
      <description>&lt;PRE&gt;if GLOB_UI_BUTTON_ID &amp;gt; 1000000 then
	n = APPLICATION_QUERY ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", _isFirstRun)	!&amp;lt;-- prevents unnecessary consecutive entries

	if _isFirstRun then
		dim			_ap_openingLintel[][],	_ap_openingLintelHieght[][],	!&amp;lt;-- create dummy containers
					_ap_openingsX[][],		_ap_openingsY[][],
					_ap_openingSizeX[][],	_ap_openingSizeY[][]

		parameters	_delItem = (GLOB_UI_BUTTON_ID - 1000000),				!&amp;lt;-- 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
&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
Well that is the code I have put in the "&lt;B&gt;Parameter Script&lt;/B&gt;", and although I´m sure that GLOB_UI_BUTTON_ID &amp;gt; 1000000 works fine, the parameters (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;&lt;B&gt;&lt;FONT color="#FF0000"&gt;and not variables&lt;/FONT&gt;&lt;/B&gt;&lt;E&gt;&lt;/E&gt;) do not update.</description>
      <pubDate>Fri, 25 Jan 2019 02:01:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278939#M3093</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-25T02:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278940#M3094</link>
      <description>I still have this problem that the array parameter item doesn't delete</description>
      <pubDate>Mon, 28 Jan 2019 15:16:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278940#M3094</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-28T15:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Delete an item from a Parameter Array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278941#M3095</link>
      <description>To everyone,&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Second, the right way (in my case) to do update/delete array parameters is using this simple code that was posted in this thread &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?t=30992&amp;amp;start=30" target="_blank"&gt;&lt;LINK_TEXT text="viewtopic.php?t=30992&amp;amp;start=30"&gt;https://archicad-talk.graphisoft.com/viewtopic.php?t=30992&amp;amp;start=30&lt;/LINK_TEXT&gt;&lt;/A&gt; (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;special thanks to Braza from Portugal, see attachment &lt;E&gt;&lt;/E&gt;)&lt;BR /&gt;
&lt;BR /&gt;
here is the script (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;adapted to Graphisoft Style recommendations&lt;E&gt;&lt;/E&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;

&lt;PRE&gt;dim setval[]
for i = 1 to n

	if i &amp;gt; vardim1(val) then
		setval&lt;I&gt; = 0
	else
		setval&lt;I&gt;=val&lt;I&gt;
	endif
next i

val = setval

parameters val = val&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
&lt;B&gt;&lt;FONT size="150"&gt;&lt;FONT color="#FF0000"&gt;&lt;BR /&gt;
Third the most important part, Why the hell my past code did not update my arrays !!!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Well it happens that this line script in the Parameter Script tab did give me all the trouble:&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;n = APPLICATION_QUERY ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", _isFirstRun)
&lt;/PRE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
I will put this finding as an issue for Graphisoft Team.&lt;BR /&gt;
&lt;BR /&gt;
Thank you all</description>
      <pubDate>Tue, 29 Jan 2019 16:54:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Delete-an-item-from-a-Parameter-Array/m-p/278941#M3095</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-29T16:54:42Z</dc:date>
    </item>
  </channel>
</rss>

