<?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: Categories and Properties Label in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228780#M7337</link>
    <description>Thanks for your reply. I was able to work it out stealing some GS code. This is what I have done in case it helps anyone. This gives me two returned values. "Door Type" and "Door Number"&lt;BR /&gt;
&lt;BR /&gt;
DoorNumber = ""&lt;BR /&gt;
DoorType = ""&lt;BR /&gt;
_stPropertyValue = ""&lt;BR /&gt;
&lt;BR /&gt;
	DIM parentProperties[]&lt;BR /&gt;
	tom = REQUEST ("Properties_Of_Parent", "", parentProperties)&lt;BR /&gt;
	_numProperties = vardim1(parentProperties)&lt;BR /&gt;
	for i = 1 to _numProperties&lt;BR /&gt;
		if parentProperties&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = "Door Number" then&lt;BR /&gt;
			DoorNumberID = parentProperties[i-3]&lt;BR /&gt;
		endif&lt;BR /&gt;
		if parentProperties&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = "Door Type" then&lt;BR /&gt;
			DoorTypeID = parentProperties[i-3]&lt;BR /&gt;
		endif&lt;BR /&gt;
	next i&lt;BR /&gt;
	&lt;BR /&gt;
	_stPropertyID = DoorNumberID&lt;BR /&gt;
	gosub "getPropertyValue"&lt;BR /&gt;
	DoorNumber = _stPropertyValue&lt;BR /&gt;
&lt;BR /&gt;
	_stPropertyValue = ""&lt;BR /&gt;
&lt;BR /&gt;
	_stPropertyID = DoorTypeID&lt;BR /&gt;
	gosub "getPropertyValue"&lt;BR /&gt;
	DoorType = _stPropertyValue&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!=============================&lt;BR /&gt;
!MAIN LABEL CODE.....&lt;BR /&gt;
&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
! ==============================================================================&lt;BR /&gt;
"getPropertyValue":&lt;BR /&gt;
! ==============================================================================&lt;BR /&gt;
	dim	propertyValues[]&lt;BR /&gt;
	m = REQUEST ("Property_Value_Of_Parent", _stPropertyID, _typeValue, dim1, dim2, propertyValues)&lt;BR /&gt;
&lt;BR /&gt;
	if m &amp;gt; 3 then&lt;BR /&gt;
		for j = 1 to vardim1(propertyValues)&lt;BR /&gt;
			if j &amp;gt; 1 then&lt;BR /&gt;
				_stPropertyValue = _stPropertyValue + "; "&lt;BR /&gt;
			endif&lt;BR /&gt;
&lt;BR /&gt;
			if _typeValue = 4 then&lt;BR /&gt;
				_stPropertyValue = _stPropertyValue + propertyValues&lt;J&gt;&lt;BR /&gt;
			else&lt;BR /&gt;
				if _typeValue = 3 then&lt;BR /&gt;
					_stPropertyValue = _stPropertyValue + str ("%.2", propertyValues&lt;J&gt;)&lt;BR /&gt;
				else&lt;BR /&gt;
					if _typeValue = 2 then&lt;BR /&gt;
						_stPropertyValue = _stPropertyValue + str ("%.0", propertyValues&lt;J&gt;)&lt;BR /&gt;
					else&lt;BR /&gt;
						if propertyValues&lt;J&gt; &amp;gt; 0 then&lt;BR /&gt;
							_stPropertyValue = _stPropertyValue + `TRUE`&lt;BR /&gt;
						else&lt;BR /&gt;
							_stPropertyValue = _stPropertyValue + `FALSE`&lt;BR /&gt;
						endif&lt;BR /&gt;
					endif&lt;BR /&gt;
				endif&lt;BR /&gt;
			endif&lt;BR /&gt;
		next j&lt;BR /&gt;
	else&lt;BR /&gt;
		_stPropertyValue = "&amp;lt;" + `Property Value` + "&amp;gt;"&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
return&lt;/J&gt;&lt;/J&gt;&lt;/J&gt;&lt;/J&gt;</description>
    <pubDate>Wed, 14 Sep 2016 00:33:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-09-14T00:33:49Z</dc:date>
    <item>
      <title>Categories and Properties Label</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228778#M7335</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi,&lt;BR /&gt;
Has anyone been able to successfully code a custom categories and properties label? We plan on using properties for things like wall types.&lt;BR /&gt;
&lt;BR /&gt;
What I am having trouble with is accessing the array formed from the following request.&lt;BR /&gt;
DIM propertyValues[]&lt;BR /&gt;
REQUEST ("Property_Value_Of_Parent", "id", type, dim1, dim2, propertyValues)&lt;BR /&gt;
&lt;BR /&gt;
I have not had problem with arrays before, but this seems to be tricky. Not really sure why it needs to be an array as it should be a single field as you need to identify the id?&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Sep 2016 01:39:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228778#M7335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-13T01:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Categories and Properties Label</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228779#M7336</link>
      <description>&lt;BLOCKQUOTE&gt;Tom wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;
Has anyone been able to successfully code a custom categories and properties label? We plan on using properties for things like wall types.&lt;BR /&gt;
&lt;BR /&gt;
What I am having trouble with is accessing the array formed from the following request.&lt;BR /&gt;
DIM propertyValues[]&lt;BR /&gt;
REQUEST ("Property_Value_Of_Parent", "id", type, dim1, dim2, propertyValues)&lt;BR /&gt;
&lt;BR /&gt;
I have not had problem with arrays before, but this seems to be tricky. Not really sure why it needs to be an array as it should be a single field as you need to identify the id?&lt;/BLOCKQUOTE&gt;

Hi.&lt;BR /&gt;
This is a nice challenge!&lt;BR /&gt;
&lt;BR /&gt;
As noted in &lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=53595" target="_blank"&gt;this thread&lt;/A&gt;, returned arrays can be of mixed type, so correct handling of data depends on that. As for why it needs to be an array... I guess is because some properties allow you to set a list of values, and in some cases you can have multiple selections, so you need to have a way to retrieve all those values to use in your label.&lt;BR /&gt;
&lt;BR /&gt;
Best regards.</description>
      <pubDate>Wed, 14 Sep 2016 00:28:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228779#M7336</guid>
      <dc:creator>sinceV6</dc:creator>
      <dc:date>2016-09-14T00:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Categories and Properties Label</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228780#M7337</link>
      <description>Thanks for your reply. I was able to work it out stealing some GS code. This is what I have done in case it helps anyone. This gives me two returned values. "Door Type" and "Door Number"&lt;BR /&gt;
&lt;BR /&gt;
DoorNumber = ""&lt;BR /&gt;
DoorType = ""&lt;BR /&gt;
_stPropertyValue = ""&lt;BR /&gt;
&lt;BR /&gt;
	DIM parentProperties[]&lt;BR /&gt;
	tom = REQUEST ("Properties_Of_Parent", "", parentProperties)&lt;BR /&gt;
	_numProperties = vardim1(parentProperties)&lt;BR /&gt;
	for i = 1 to _numProperties&lt;BR /&gt;
		if parentProperties&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = "Door Number" then&lt;BR /&gt;
			DoorNumberID = parentProperties[i-3]&lt;BR /&gt;
		endif&lt;BR /&gt;
		if parentProperties&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = "Door Type" then&lt;BR /&gt;
			DoorTypeID = parentProperties[i-3]&lt;BR /&gt;
		endif&lt;BR /&gt;
	next i&lt;BR /&gt;
	&lt;BR /&gt;
	_stPropertyID = DoorNumberID&lt;BR /&gt;
	gosub "getPropertyValue"&lt;BR /&gt;
	DoorNumber = _stPropertyValue&lt;BR /&gt;
&lt;BR /&gt;
	_stPropertyValue = ""&lt;BR /&gt;
&lt;BR /&gt;
	_stPropertyID = DoorTypeID&lt;BR /&gt;
	gosub "getPropertyValue"&lt;BR /&gt;
	DoorType = _stPropertyValue&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!=============================&lt;BR /&gt;
!MAIN LABEL CODE.....&lt;BR /&gt;
&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
! ==============================================================================&lt;BR /&gt;
"getPropertyValue":&lt;BR /&gt;
! ==============================================================================&lt;BR /&gt;
	dim	propertyValues[]&lt;BR /&gt;
	m = REQUEST ("Property_Value_Of_Parent", _stPropertyID, _typeValue, dim1, dim2, propertyValues)&lt;BR /&gt;
&lt;BR /&gt;
	if m &amp;gt; 3 then&lt;BR /&gt;
		for j = 1 to vardim1(propertyValues)&lt;BR /&gt;
			if j &amp;gt; 1 then&lt;BR /&gt;
				_stPropertyValue = _stPropertyValue + "; "&lt;BR /&gt;
			endif&lt;BR /&gt;
&lt;BR /&gt;
			if _typeValue = 4 then&lt;BR /&gt;
				_stPropertyValue = _stPropertyValue + propertyValues&lt;J&gt;&lt;BR /&gt;
			else&lt;BR /&gt;
				if _typeValue = 3 then&lt;BR /&gt;
					_stPropertyValue = _stPropertyValue + str ("%.2", propertyValues&lt;J&gt;)&lt;BR /&gt;
				else&lt;BR /&gt;
					if _typeValue = 2 then&lt;BR /&gt;
						_stPropertyValue = _stPropertyValue + str ("%.0", propertyValues&lt;J&gt;)&lt;BR /&gt;
					else&lt;BR /&gt;
						if propertyValues&lt;J&gt; &amp;gt; 0 then&lt;BR /&gt;
							_stPropertyValue = _stPropertyValue + `TRUE`&lt;BR /&gt;
						else&lt;BR /&gt;
							_stPropertyValue = _stPropertyValue + `FALSE`&lt;BR /&gt;
						endif&lt;BR /&gt;
					endif&lt;BR /&gt;
				endif&lt;BR /&gt;
			endif&lt;BR /&gt;
		next j&lt;BR /&gt;
	else&lt;BR /&gt;
		_stPropertyValue = "&amp;lt;" + `Property Value` + "&amp;gt;"&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
return&lt;/J&gt;&lt;/J&gt;&lt;/J&gt;&lt;/J&gt;</description>
      <pubDate>Wed, 14 Sep 2016 00:33:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Categories-and-Properties-Label/m-p/228780#M7337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-14T00:33:49Z</dc:date>
    </item>
  </channel>
</rss>

