<?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: Building Material list - alphabetical order in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257523#M2949</link>
    <description>Thought you mean using a list in Values. To display a list of materials on the plan, you can do this &lt;PRE&gt;!!!------------------ SORT ---------------------
dim mat_inx[][]
name = "" : id = "" : _fillType = 0 : _fillPen = 0 : _fillBgPen = 0
n_material = 0
for index=0 to 1000
	n = REQUEST ("Name_of_material", index, name)
	if n then
		n = REQUEST{2} ("Building_Material_info", index, "gs_bmat_id", id)
		n = REQUEST{2} ("Building_Material_info", index, "gs_bmat_cutfill_properties", _fillType, _fillPen, _fillBgPen)
		n_material = n_material + 1
		mat_inx[n_material][1] = index
		mat_inx[n_material][2] = name
		mat_inx[n_material][3] = id

		mat_inx[n_material][4] = _fillType
		mat_inx[n_material][5] = _fillPen
		mat_inx[n_material][6] = _fillBgPen
	endif
next index

for n = 1 to n_material
	for m = n to n_material
		if mat_inx&lt;N&gt;[sort_col] &amp;gt; mat_inx&lt;M&gt;[sort_col] then
			for k=1 to vardim2(mat_inx)
				_temp = mat_inx&lt;N&gt;&lt;K&gt;
				mat_inx&lt;N&gt;&lt;K&gt; = mat_inx&lt;M&gt;&lt;K&gt;
				mat_inx&lt;M&gt;&lt;K&gt; = _temp
			next k
		endif
	next m
next n
!!!------------------ SORT ---------------------&lt;/K&gt;&lt;/M&gt;&lt;/K&gt;&lt;/M&gt;&lt;/K&gt;&lt;/N&gt;&lt;/K&gt;&lt;/N&gt;&lt;/M&gt;&lt;/N&gt;&lt;/PRE&gt;
sort_col = 2 for sort by ID</description>
    <pubDate>Thu, 08 Apr 2021 14:01:41 GMT</pubDate>
    <dc:creator>kuvbur</dc:creator>
    <dc:date>2021-04-08T14:01:41Z</dc:date>
    <item>
      <title>Building Material list - alphabetical order</title>
      <link>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257521#M2947</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Dear all,&lt;BR /&gt;&lt;BR /&gt;I would like to create custom list (like fill list from AC24 library) with building material names and fills. My problem is, that I can request the building material infos, put them in an array, but it's order based on the building material's index. I would like to list them based on the IDs alphabetically.&lt;BR /&gt;&lt;BR /&gt;Is there any way to organise or list the array so I could use it in alphabetical order?&lt;BR /&gt;&lt;BR /&gt;Thx,&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:17:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257521#M2947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T07:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Building Material list - alphabetical order</title>
      <link>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257522#M2948</link>
      <description>REQUEST ("Name_of_material" not work in parameter script, then only way is read txt file stored material name.</description>
      <pubDate>Thu, 08 Apr 2021 12:14:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257522#M2948</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2021-04-08T12:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Building Material list - alphabetical order</title>
      <link>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257523#M2949</link>
      <description>Thought you mean using a list in Values. To display a list of materials on the plan, you can do this &lt;PRE&gt;!!!------------------ SORT ---------------------
dim mat_inx[][]
name = "" : id = "" : _fillType = 0 : _fillPen = 0 : _fillBgPen = 0
n_material = 0
for index=0 to 1000
	n = REQUEST ("Name_of_material", index, name)
	if n then
		n = REQUEST{2} ("Building_Material_info", index, "gs_bmat_id", id)
		n = REQUEST{2} ("Building_Material_info", index, "gs_bmat_cutfill_properties", _fillType, _fillPen, _fillBgPen)
		n_material = n_material + 1
		mat_inx[n_material][1] = index
		mat_inx[n_material][2] = name
		mat_inx[n_material][3] = id

		mat_inx[n_material][4] = _fillType
		mat_inx[n_material][5] = _fillPen
		mat_inx[n_material][6] = _fillBgPen
	endif
next index

for n = 1 to n_material
	for m = n to n_material
		if mat_inx&lt;N&gt;[sort_col] &amp;gt; mat_inx&lt;M&gt;[sort_col] then
			for k=1 to vardim2(mat_inx)
				_temp = mat_inx&lt;N&gt;&lt;K&gt;
				mat_inx&lt;N&gt;&lt;K&gt; = mat_inx&lt;M&gt;&lt;K&gt;
				mat_inx&lt;M&gt;&lt;K&gt; = _temp
			next k
		endif
	next m
next n
!!!------------------ SORT ---------------------&lt;/K&gt;&lt;/M&gt;&lt;/K&gt;&lt;/M&gt;&lt;/K&gt;&lt;/N&gt;&lt;/K&gt;&lt;/N&gt;&lt;/M&gt;&lt;/N&gt;&lt;/PRE&gt;
sort_col = 2 for sort by ID</description>
      <pubDate>Thu, 08 Apr 2021 14:01:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Building-Material-list-alphabetical-order/m-p/257523#M2949</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2021-04-08T14:01:41Z</dc:date>
    </item>
  </channel>
</rss>

