We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-02-07 10:35 AM
Hello,
I have managed to make a request for the door leaves width via GDL on a label object.
As you can see on the screenshot bellow, the label shows the door leaves width separated by "/" and I would like to change it for "x".
Is there a way to change that character for something else?
Cheers.
Solved! Go to Solution.
2022-02-08 09:27 AM
Sure, no problem. 🙂
Not sure if I can ask in this topic or open a new one (you can let me know).
I would like to add after those two values the height of the door.
I tried making a new request and append it at the end of the new value,in theory should be like this: n_leaf1 "+" n_leaf2 "+" _heightvalue. But what I have tried it gives error in the floor plan, although the 2D script is ok.
_sPrefixStrings[iContent] = sDescriptionDoorLeavesWidth
if iDoorLeavesWidth = VALUE_AUTOMATIC then
_DoorLeavesWidth = ""
nnn = request ("ASSOCLP_PARVALUE", "gs_list_doorleafwidths", index_ww, type_ww, flags_ww, dim1_ww, dim2_ww, _DoorLeavesWidth)
nnn = request ("ASSOCLP_PARVALUE", "ac_unit_height", index_ww, type_ww, flags_ww, dim1_ww, dim2_ww, _heightValue)
if bDefaultElem then
_sContentStrings[iContent][1] = _stLocNoContent ! "<no content defined>"
else
_sContentStrings[iContent][1] = _DoorLeavesWidth
_sContentStrings[iContent][1] = _heightValue
endif
else
_sContentStrings[iContent][1] = sValueDoorLeavesWidth
endif
return
2022-02-08 10:37 AM - last edited on 2022-02-13 07:41 PM by Laszlo Nagy
I guess it is all related to the original question so we will leave it together.
First ...
I don't know if you need that array, or at least you need a new one because you are assigning 2 different values to the same array variable.
I am not sure what they are used for - it is hard not seeing the whole label.
Second you are getting the unit height and assigning it to the _heightValue variable.
This is a number (length) variable.
I think all you need to do is convert that number to a string so you can tack it onto the end of the string you want to use in your label.
Something like this?
s_heightvalue = STR(_heightvalue, 3, 0)
Then use this for the string output in your label ...
s_leaf_1 + " x " + s_leaf_2 + s_heightvalue
Barry.
2022-02-08 04:08 PM
Awesome, I think I got the hang of it. Thank you so much. 👍
Now everthing is up and running.
Can I accept two solutions in the same topic?
2022-02-09 03:59 AM
@jc4d wrote:
Can I accept two solutions in the same topic?
I believe so.
Barry.