<?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: Possible to use element property value in a label? in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368068#M666</link>
    <description>&lt;P&gt;It's not what I'm after. It's up to 6 different properties (= 6 colored blobs in a 2x3 matrix)..&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-01-19_15-32-12.png" style="width: 385px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/33552iBD875226F3E5D47F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-01-19_15-32-12.png" alt="2023-01-19_15-32-12.png" /&gt;&lt;/span&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 14:34:09 GMT</pubDate>
    <dc:creator>Mats_Knutsson</dc:creator>
    <dc:date>2023-01-19T14:34:09Z</dc:date>
    <item>
      <title>Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368048#M663</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'd like to create a label with a 2D geometry, say a circle that changes color according to the value (text content) of a certain property. Is this possible? Let's say I've created a property "LENNART" available for doors. The property is an option set with values A, B and C and the label should change colour depending on the property value... A=red, B=green etc.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LENNART.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/33547i8890A5B267DAC213/image-size/large?v=v2&amp;amp;px=999" role="button" title="LENNART.png" alt="LENNART.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Mats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 09:29:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368048#M663</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2023-01-19T09:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368051#M664</link>
      <description>&lt;P&gt;In short: it does not work. A GO rule can't catch the label – since it does not have the property.&lt;/P&gt;&lt;P&gt;And the GDL label itself can not be stylyed either, since it can't read the property (it only gets a GUID as reference pointer).&lt;/P&gt;&lt;P&gt;It's mad. Probably GS themself has no clue what the endgame here is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the idea is brilliant, and I know someone who scripted a door for their office having this feature built in. Then the GO kicks in and styles the circle.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 10:25:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368051#M664</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2023-01-19T10:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368057#M665</link>
      <description>&lt;P&gt;We have set up a Graphic Override which searches for a Property assigned to Doors to determine if the door is Existing, New Leaf in Existing Opening, New Doorset in existing opening and New Door. The graphic override then changes the colours of the doors themselves to match a pre-defined Key so we generate a Door Key Plan.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 11:59:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368057#M665</guid>
      <dc:creator>Lee Hankins</dc:creator>
      <dc:date>2023-01-19T11:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368068#M666</link>
      <description>&lt;P&gt;It's not what I'm after. It's up to 6 different properties (= 6 colored blobs in a 2x3 matrix)..&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-01-19_15-32-12.png" style="width: 385px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/33552iBD875226F3E5D47F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-01-19_15-32-12.png" alt="2023-01-19_15-32-12.png" /&gt;&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 14:34:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368068#M666</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2023-01-19T14:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368069#M667</link>
      <description>&lt;P&gt;Not currently possible with our a python script.&lt;/P&gt;&lt;P&gt;You can use the id of the door to change both a label and the door object and property&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 14:41:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368069#M667</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2023-01-19T14:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368102#M668</link>
      <description>&lt;P&gt;Just to clarify for those interested in how a Python script works in Archicad and why it is so limited. it is possible, but I think you would agree that the configuration is more trouble than worth in this instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem, as said, is that labels are 2D elements and 2D elements can not contain properties. The work around is to simply create a object which is simply a circle with a fill. Then classify it and add the option property. You would need to add a second property tying it to a door ID and perhaps a third property identifying the object as a door identifier -- or maybe just use the classification.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Python script would read the door criteria (whatever) and the associated symbol ID and then set the symbol option accordingly. A graphic override (one for each option)&amp;nbsp; would then set the colors according to the option value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IOW -- just set the door id accordingly -- or modify the door gsm to include a color identifier and good luck with that?.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 19:26:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368102#M668</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-01-19T19:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368158#M669</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7804"&gt;@poco2013&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The problem, as said, is that labels are 2D elements and 2D elements can not contain properties.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The label does not need to contain the property.&lt;/P&gt;
&lt;P&gt;It reads the property from the object, which can be done.&lt;/P&gt;
&lt;P&gt;The label can read and display the property with no problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question is can the label read the value of the property and act on it.&lt;/P&gt;
&lt;P&gt;If property value = A then change the label colour to red.&lt;/P&gt;
&lt;P&gt;If property value = B then change the label colour to blue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without setting it all up, off the top of my head I can't remember if the label can utilise the value of a property or as runxel said it can only read and display the property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No time to investigate right at the moment.&lt;/P&gt;
&lt;P&gt;But if I get a chance later I will have a look.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 01:16:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368158#M669</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-01-20T01:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368163#M670</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7331"&gt;@Barry Kelly&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;The question is can the label read the value of the property and act on it.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;To my knowledge, OOTB Archicad labels do not feature any custom actions, other than programed. I presume you are suggesting writing a custom gsm label. Than I would agree that it would be possible since associated labels contain a parent GUID field or you could use the parent ID field if it was unique. This would not be possible with a Python script since it can not, at present, address the label type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, this could be easily done with a C++ AddOn but i don't think anyone wants to go there.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 01:55:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368163#M670</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-01-20T01:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368224#M671</link>
      <description>&lt;P&gt;Yes, a GDL label can do that.&lt;/P&gt;&lt;P&gt;In general, you can request &lt;SPAN&gt;PROPERTIES_OF_&lt;SPAN class=""&gt;PARENT&lt;/SPAN&gt;&lt;/SPAN&gt; and then populate them using &lt;SPAN&gt;UI_CUSTOM_POPUP_INFIELD, in the UI scrip, to a parameter (a string type). Then assign it to "LENNART" by using the "Parameters" tab/page on GDL editing window, or by using the UI.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in 2D script, you then request PROPERTY_VALUE_OF_PARENT and use the value like;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if value = "A" then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...set your backgroud fill/pen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There might be more requests needed. This is just from the top of my head. Sorry if I missed anything. But the thing is, if a built-in Properties Label exists, then label can definitely get that data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 11:25:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368224#M671</guid>
      <dc:creator>Palawat</dc:creator>
      <dc:date>2023-01-20T11:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368228#M672</link>
      <description>&lt;P&gt;This would make a perfect tutorial case for custom gdl label scripting :). I don't know how to do this...&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 12:58:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368228#M672</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2023-01-20T12:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368235#M673</link>
      <description>&lt;P&gt;Pm me I have a label that already reads properties.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 14:15:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368235#M673</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2023-01-20T14:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to use element property value in a label?</title>
      <link>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368329#M674</link>
      <description>&lt;P&gt;This is not a tutorial but it should help.&lt;/P&gt;&lt;P&gt;First, you need a parameter (a string type) to act as an "id" (as in GDL Ref. Guide for &lt;SPAN&gt;&lt;SPAN class=""&gt;PROPERTY_VALUE_OF&lt;/SPAN&gt;_PARENT&lt;/SPAN&gt;). Let's call it "criteriaProp".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="createParam.jpg" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/33666i1F7F080EAFF73CC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="createParam.jpg" alt="createParam.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; *The "gs_ui_current_page" is there for the UI script to work. If you don't have it already, please create it too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UI script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ui_dialog "Test Label"

dim pageTitle[1]
pageTitle[1] = "Custom Settings"

dim pageIcon[1]
pageIcon[1] = ""

dim pageID[1]
pageID[1] = 1

ui_current_page gs_ui_current_page
ui_page gs_ui_current_page


! Page 1 --------------------------------------------------------------------------------
ui_page 1, -1, pageTitle[1], pageIcon[1]

dim parentProperties[]
n = request ("Properties_Of_Parent", "", parentProperties)
n = request ("Property_Name", criteriaProp, typeName, groupName, propertyName)

ui_custom_popup_infield	"criteriaProp", 10, 20, 200, 20,
						1, 3, 2, propertyName,
						"None", "", "", "None",
						parentProperties&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, we populate the requested "parentProperties" into "criteriaProp" so you can select which property to use as a criteria.&lt;/P&gt;&lt;P&gt;The requested "propertyName" is there so the UI show the title instead of "id" after a property is selected. (Within the ui_custom_popup_infield .... , try and replace it with "" and see what happen after selecting the property in UI).&lt;/P&gt;&lt;P&gt;The "None", ... is there in case there is no supported property, just in case...really. You can also set the parameter to "None" as default if you want to.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ui.jpg" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/33667i92C94169CE895EC1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ui.jpg" alt="ui.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2D script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;! Getting value ---------------------------------------------
taggedValue = ""

dim propertyValues[][]
dim1 = 0
dim2 = 0
type = 1

n = request ("Property_Value_Of_Parent", criteriaProp, type, dim1, dim2, propertyValues)

if n &amp;amp; (glob_elem_type = 3 | glob_elem_type = 4) then	! Label works on D/W only.

	if type = 4 then	! String
		taggedValue = propertyValues[1][1]
	else
		text2 0, 0, "The criteria selected is not supported"
	endif
else
	text2 0, 0, "The Element/Property selected is not supported."
endif

! Start doing your thing ------------------------------------

text2 0, 0, taggedValue		! Just to check the value. Comment this out or delete it later.

if taggedValue &amp;lt;&amp;gt; "" then
	if taggedValue = "A" then
		! set your background fill/pen
	endif
	if taggedValue = "B" then
		! set your background fill/pen
	endif

	!.......

endif&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we request &lt;SPAN&gt;&lt;SPAN class=""&gt;PROPERTY_VALUE_OF&lt;/SPAN&gt;_PARENT&lt;/SPAN&gt; which return the value via propertyValues (2 dimensional array). In this case, we know for sure that dim1 = 0, dim2 = 0 since we create the property "LENNART" ourselves. So there's no need to fuzzing around dim1 and dim2. The value we want is propertyValues[1][1]. Just assign it to a variable "taggedValue" then manage from there. (Note: You don't really need the "taggedValue", but it is a lot nicer than using propertyValues[1][1] every time.)&lt;/P&gt;&lt;P&gt;You can also disregard the glob_elem_type thing if you don't want to limit the label to be used only with D/W.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have fun scripting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 04:48:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Possible-to-use-element-property-value-in-a-label/m-p/368329#M674</guid>
      <dc:creator>Palawat</dc:creator>
      <dc:date>2023-01-21T04:48:12Z</dc:date>
    </item>
  </channel>
</rss>

