<?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: GDL: glob_modpar_name - Arrays in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376363#M1111</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not sure if it helps, but maybe the confusion comes from using GLOB_MODPAR_NAME. That only contains the name of the parameter which the user modified manually. It doesn't react to PARAMETERS commands in the code.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2023 07:47:21 GMT</pubDate>
    <dc:creator>Peter Baksa</dc:creator>
    <dc:date>2023-04-12T07:47:21Z</dc:date>
    <item>
      <title>GDL: glob_modpar_name - Arrays</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/375536#M1109</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 integer parameters, &lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;x&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;y&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; which are each linked to the size of 9 other array parameters, 4 unique and 5 common. These common arrays only update if the modification of &lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;x&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; or &lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;y&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; is greater than the other, max(&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;x&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; ,&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;y&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I modify&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;x&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;all 9 relevant arrays update. The issue is that when I modify &lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, it's relevant 8 arrays DO NOT update UNTIL you modify &lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;x&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;... This though highly inconvenient is managable as you can follow up any changed to &lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&lt;EM&gt;y&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; with an increase to &lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;x&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; before reverting it's value inorder to get everything to update. The major issue is that there is one array (sg_customBasePrefix) that does not update at all meaning that the object breaks if you increase &lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; beyond the existing size of this array...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The current object can be found over at &lt;A href="https://community.graphisoft.com/t5/Document-Visualize-forum/Level-Marking-in-Section-and-Elevation-for-a-Site-with-Multiple/td-p/373933" target="_self"&gt;this thread&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 02:31:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/375536#M1109</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-04-06T02:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: glob_modpar_name - Arrays</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376200#M1110</link>
      <description>&lt;LI-CODE lang="cpp"&gt;!========== Levels Array ==========

IF sg_base_toggle then sg_noStoreyAbove = sg_noStoreyAbove + 1

IF GLOB_MODPAR_NAME = "sg_noStoreyAbove" then
	name = sg_name_prefix + STR ("%2.0", i)
	! allow decrease, vardim1 tells stored array vertical size
	sizetokeep = min(vardim1(sg_custom), sg_noStoreyAbove)

	! copy existing values
	dim sg_styToSty_temp[]
	dim sg_custom_temp[]
	dim sg_customName_temp[][]
	dim sg_customPrefix_temp[][]
	for i = 1 to sizetokeep
		sg_styToSty_temp[i]			= sg_styToSty[i]
		sg_custom_temp[i]			= sg_custom[i]
		sg_customName_temp[i][1]	= name
		sg_customName_temp[i][2]	= sg_customName[i][2]
		sg_customPrefix_temp[i][1]	= name
		sg_customPrefix_temp[i][2]	= sg_customPrefix[i][2]
	next i

	! initialize new values, will be skipped when decreasing size
	for i = sizetokeep + 1 to sg_noStoreyAbove
		sg_styToSty_temp[i]			= sg_styToSty_def
		sg_custom_temp[i]			= 0
		sg_customName_temp[i][1]	= name
		sg_customName_temp[i][2]	= 0
		sg_customPrefix_temp[i][1]	= name
		sg_customPrefix_temp[i][2]	= ""
	next i

	! store array with new size
	sg_styToSty						= sg_styToSty_temp
	sg_custom						= sg_custom_temp
	sg_customName					= sg_customName_temp
	sg_customPrefix					= sg_customPrefix_temp
	parameters sg_styToSty			= sg_styToSty_temp
	parameters sg_custom			= sg_custom
	parameters sg_customName		= sg_customName
	parameters sg_customPrefix 		= sg_customPrefix
endIF

FOR i = 1 to sg_noStoreyAbove
	name = sg_name_prefix + STR ("%2.0", i)
	IF sg_custom[i] # 0 then	PARAMETERS sg_customName[i][1] = name
next i



!========== Basement Array ==========

IF GLOB_MODPAR_NAME = "sg_noBasement" then
	name = sg_nameBase_prefix + STR ("%2.0", j)
	! allow decrease, vardim1 tells stored array vertical size
	sizetokeep = min(vardim1(sg_customBase), sg_noBasement)

	! copy existing values
	dim sg_basementHTs_temp[]
	dim sg_customBase_temp[]
	dim sg_customBaseName_temp[][]
	dim sg_customBasePrefix_temp[][]
	for j = 1 to sizetokeep
		sg_basementHTs_temp[j]			= sg_basementHTs[j]
		sg_customBase_temp[j]			= sg_customBase[j]
		sg_customBaseName_temp[j][1]	= name
		sg_customBaseName_temp[j][2]	= sg_customBaseName[j][2]
		sg_customBasePrefix_temp[i][1]	= name
		sg_customBasePrefix_temp[i][2]	= sg_customBasePrefix[i][2]
	next j

	! initialize new values, will be skipped when decreasing size
	for j = sizetokeep + 1 to sg_noBasement
		sg_basementHTs_temp[j]			= sg_styToSty_def 
		sg_customBase_temp[j]			= 0
		sg_customBaseName_temp[j][1]	= name
		sg_customBaseName_temp[j][2]	= 0
		sg_customBasePrefix_temp[i][1]	= name
		sg_customBasePrefix_temp[i][2]	= ""
	next j

	! store array with new size
	sg_basementHTs						= sg_basementHTs_temp
	sg_customBase						= sg_customBase_temp
	sg_customBaseName					= sg_customBaseName_temp
	sg_customBasePrefix					= sg_customBasePrefix_temp
	parameters sg_basementHTs			= sg_basementHTs
	parameters sg_customBase			= sg_customBase
	parameters sg_customBaseName		= sg_customBaseName
	parameters sg_customBasePrefix	 	= sg_customBasePrefix
endIF

FOR j = 1 to sg_noBasement
	name = sg_nameBase_prefix + STR ("%2.0", j)
	IF sg_customBase[j] # 0 then	PARAMETERS sg_customBaseName[j][1] = name
next j



!========== Grid Lengths Array ==========

IF GLOB_MODPAR_NAME = "sg_noStoreyAbove" | GLOB_MODPAR_NAME = "sg_noBasement" then

	IF sg_base_toggle then sg_noStoreyAbove = sg_noStoreyAbove + 1
	IF sg_noStoreyAbove &amp;gt; sg_noBasement then
			sizetokeep = min(vardim1(sg_customName), sg_noStoreyAbove)
		
			! copy existing values
			dim sg_lengthCustom_temp[][]
			dim sg_lengthCustom2_temp[][]
			dim sg_lengthToggle_temp[][]
			dim lp1_temp[][]
			dim lp2_h_temp[][]
			dim lp2_v_temp[][]
			for i = 1 to sizetokeep
				sg_lengthCustom_temp[i][1]	= sg_lengthCustom[i][1]
				sg_lengthCustom_temp[i][2]	= sg_lengthCustom[i][2]
				sg_lengthCustom2_temp[i][1]	= sg_lengthCustom2[i][1]
				sg_lengthCustom2_temp[i][2]	= sg_lengthCustom2[i][2]
				sg_lengthToggle_temp[i][1]	= sg_lengthToggle[i][1]
				sg_lengthToggle_temp[i][2]	= sg_lengthToggle[i][2]
				lp1_temp[i][1]				= lp1[i][1]
				lp1_temp[i][2]				= lp1[i][2]
				lp1_temp[i][3]				= lp1[i][3]
				lp1_temp[i][4]				= lp1[i][4]
				lp2_h_temp[i][1]			= lp2_h[i][1]
				lp2_h_temp[i][2]			= lp2_h[i][2]
				lp2_h_temp[i][3]			= lp2_h[i][3]
				lp2_h_temp[i][4]			= lp2_h[i][4]
				lp2_v_temp[i][1]			= lp2_v[i][1] 
				lp2_v_temp[i][2]			= lp2_v[i][2]
				lp2_v_temp[i][3]			= lp2_v[i][3]
				lp2_v_temp[i][4]			= lp2_v[i][4]
			next i
		
			! initialize new values, will be skipped when decreasing size
			for i = sizetokeep + 1 to sg_noStoreyAbove
				sg_lengthCustom_temp[i][1]	= sg_length
				sg_lengthCustom_temp[i][2]	= 0
				sg_lengthCustom2_temp[i][1] = 0
				sg_lengthCustom2_temp[i][2] = 0
				sg_lengthToggle_temp[i][1]	= 0
				sg_lengthToggle_temp[i][2]	= 0
				lp1_temp[i][1]				= marker_length/4
				lp1_temp[i][2]				= marker_length/4
				lp1_temp[i][3]				= marker_length/4
				lp1_temp[i][4]				= marker_length/4
				lp2_h_temp[i][1]			= marker_length/4
				lp2_h_temp[i][2]			= marker_length/4
				lp2_h_temp[i][3]			= marker_length/4
				lp2_h_temp[i][4]			= marker_length/4
				lp2_v_temp[i][1]			= 0
				lp2_v_temp[i][2]			= 0
				lp2_v_temp[i][3]			= 0
				lp2_v_temp[i][4]			= 0
			next i
		
			! store array with new size
			sg_lengthCustom				= sg_lengthCustom_temp
			sg_lengthCustom2			= sg_lengthCustom2_temp
			sg_lengthToggle				= sg_lengthToggle_temp
			lp1							= lp1_temp
			lp2_h						= lp2_h_temp
			lp2_v						= lp2_v_temp 
			parameters sg_lengthCustom	= sg_lengthCustom
			parameters sg_lengthCustom2	= sg_lengthCustom2
			parameters sg_lengthToggle	= sg_lengthToggle
			parameters lp1				= lp1
			parameters lp2_h			= lp2_h
			parameters lp2_v			= lp2_v
		ELSE
			sizetokeep = min(vardim1(sg_customBaseName), sg_noBasement)
		
			! copy existing values
			dim sg_lengthCustom_temp[][]
			dim	sg_lengthCustom2_temp[][]
			dim sg_lengthToggle_temp[][]
			dim lp1_temp[][]
			dim lp2_h_temp[][]
			dim lp2_v_temp[][]
			for i = 1 to sizetokeep
				sg_lengthCustom_temp[i][1]	= sg_lengthCustom[i][1]
				sg_lengthCustom_temp[i][2]	= sg_lengthCustom[i][2]
				sg_lengthCustom2_temp[i][1]	= sg_lengthCustom2[i][1]
				sg_lengthCustom2_temp[i][2]	= sg_lengthCustom2[i][2]
				sg_lengthToggle_temp[i][1]	= sg_lengthToggle[i][1]
				sg_lengthToggle_temp[i][2]	= sg_lengthToggle[i][2]
				lp1_temp[i][1]				= lp1[i][1]
				lp1_temp[i][2]				= lp1[i][2]
				lp1_temp[i][3]				= lp1[i][3]
				lp1_temp[i][4]				= lp1[i][4]
				lp2_h_temp[i][1]			= lp2_h[i][1]
				lp2_h_temp[i][2]			= lp2_h[i][2]
				lp2_h_temp[i][3]			= lp2_h[i][3]
				lp2_h_temp[i][4]			= lp2_h[i][4]
				lp2_v_temp[i][1]			= lp2_v[i][1] 
				lp2_v_temp[i][2]			= lp2_v[i][2]
				lp2_v_temp[i][3]			= lp2_v[i][3]
				lp2_v_temp[i][4]			= lp2_v[i][4]
			next i
		
			! initialize new values, will be skipped when decreasing size
			for i = sizetokeep + 1 to sg_noBasement
				sg_lengthCustom_temp[i][1]	= 0
				sg_lengthCustom_temp[i][2]	= sg_length
				sg_lengthCustom2_temp[i][1]	= 0
				sg_lengthCustom2_temp[i][2]	= 0
				sg_lengthToggle_temp[i][1]	= 0
				sg_lengthToggle_temp[i][2]	= 0
				lp1_temp[i][1]				= marker_length/4
				lp1_temp[i][2]				= marker_length/4
				lp1_temp[i][3]				= marker_length/4
				lp1_temp[i][4] 				= marker_length/4
				lp2_h_temp[i][1]			= marker_length/4
				lp2_h_temp[i][2]			= marker_length/4
				lp2_h_temp[i][3]			= marker_length/4
				lp2_h_temp[i][4]			= marker_length/4
				lp2_v_temp[i][1]			= 0
				lp2_v_temp[i][2]			= 0
				lp2_v_temp[i][3]			= 0
				lp2_v_temp[i][4]			= 0
			next i
		
			! store array with new size
			sg_lengthCustom				= sg_lengthCustom_temp
			sg_lengthCustom2			= sg_lengthCustom2_temp
			sg_lengthToggle				= sg_lengthToggle_temp
			lp1 						= lp1_temp
			lp2_h						= lp2_h_temp
			lp2_v						= lp2_v_temp
			parameters sg_lengthCustom	= sg_lengthCustom
			parameters sg_lengthCustom2	= sg_lengthCustom2
			parameters sg_lengthToggle	= sg_lengthToggle
			parameters lp1				= lp1
			parameters lp2_h 			= lp2_h
			parameters lp2_v 			= lp2_v
	endIF
endIF
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Apr 2023 03:40:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376200#M1110</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-04-11T03:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: glob_modpar_name - Arrays</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376363#M1111</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not sure if it helps, but maybe the confusion comes from using GLOB_MODPAR_NAME. That only contains the name of the parameter which the user modified manually. It doesn't react to PARAMETERS commands in the code.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 07:47:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376363#M1111</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-04-12T07:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: glob_modpar_name - Arrays</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376373#M1112</link>
      <description>&lt;P&gt;I found the issue. I had two&amp;nbsp;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;where there should have been&amp;nbsp;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;j&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;... That was why that one parameter was not updating, and apparently the reason why the others where only updating when the other set of arrays were updated... maybe I should have used letters which did not look so similar... Another facepalm moment...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 08:55:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-glob-modpar-name-Arrays/m-p/376373#M1112</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-04-12T08:55:42Z</dc:date>
    </item>
  </channel>
</rss>

