Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.
SOLVED!

Variable within Text

Lingwisyer
Guru
Hi all,
Figured this would similar to how it is in excel and basic but I can't figure out how to do it...

1. How do you insert a variable into a text string? eg. "1:variable_x @ A1"
2. How can you insert a text string at the end of a calculation? eg. variable_y=variable_x*5 "outlets"


Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator
Lingwisyer wrote:
1. How do you insert a variable into a text string? eg. "1:variable_x @ A1"
If variable_x is a string value then you can just concatenate (add) them together.
"1:" + variable_x + "@ A1"
If variable_x is a numeric value then you have to convert it to a string.
"1: " + STR(variable_x,2,0) + " @ A1"
Lingwisyer wrote:
2. How can you insert a text string at the end of a calculation? eg. variable_y=variable_x*5 "outlets"
variable_y must be a string variable of course.
Then same as before if variable_x is a string value then you can just concatenate (add) them together.
variable_y = variable_x + "*5 outlets"
If variable_x is a numeric value then you have to convert it to a string.
variable_y = STR(variable_x,2,0) + "*5 outlets"
Or if you actually want to multiplt variable_x * 5 then
variable_y = STR(variable_x*5,2,0) + " outlets"

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

View solution in original post

1 REPLY 1
Solution
Barry Kelly
Moderator
Lingwisyer wrote:
1. How do you insert a variable into a text string? eg. "1:variable_x @ A1"
If variable_x is a string value then you can just concatenate (add) them together.
"1:" + variable_x + "@ A1"
If variable_x is a numeric value then you have to convert it to a string.
"1: " + STR(variable_x,2,0) + " @ A1"
Lingwisyer wrote:
2. How can you insert a text string at the end of a calculation? eg. variable_y=variable_x*5 "outlets"
variable_y must be a string variable of course.
Then same as before if variable_x is a string value then you can just concatenate (add) them together.
variable_y = variable_x + "*5 outlets"
If variable_x is a numeric value then you have to convert it to a string.
variable_y = STR(variable_x,2,0) + "*5 outlets"
Or if you actually want to multiplt variable_x * 5 then
variable_y = STR(variable_x*5,2,0) + " outlets"

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