Modeling
About Archicad's design tools, element connections, modeling concepts, etc.
SOLVED!

Custom character separator for requested parameter

jc4d
Expert

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?

 

jc4d_0-1644226380718.png

 

Cheers.

13 REPLIES 13

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

 

Solution

I guess it is all related to the original question so we will leave it together.

First ...

BarryKelly_0-1644311814828.png

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.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

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?


@jc4d wrote:

Can I accept two solutions in the same topic?


I believe so.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11