Text from a numeric value

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-14
06:07 AM
- last edited on
‎2023-05-24
10:38 AM
by
Rubia Torres
‎2003-11-14
06:07 AM
I need to insert a dimension value into a text string. Im not sure if this is possible. Any ideas?
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
6 REPLIES 6
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-14 06:54 AM
‎2003-11-14
06:54 AM
I think you want translate a variable from Numeric type to String type. Isn't it?
You can do it with STR() function, see more info in manual.
You can do it with STR() function, see more info in manual.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-14 07:48 AM
‎2003-11-14
07:48 AM
it must be Friday as i cant see any STR functions that do that
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-14 05:10 PM
‎2003-11-14
05:10 PM
The STR() function will convert a numeric value into a formatted text "string". You will need to decide what kind of formatting you want to have expressed and assign it to the raw value.
This example takes the Object's raw width, "A", and raw height, "B", and formats the measured value into text strings defined as "String_W" and "String_H" formatted into feet and fractional inches with a precision of 1/16":
String_W=str("%0.16ffi", A)
String_H=str("%0.16ffi", B)
The GDL Manual section of the Help file can explain the formatting in depth.
This example takes the Object's raw width, "A", and raw height, "B", and formats the measured value into text strings defined as "String_W" and "String_H" formatted into feet and fractional inches with a precision of 1/16":
String_W=str("%0.16ffi", A)
String_H=str("%0.16ffi", B)
The GDL Manual section of the Help file can explain the formatting in depth.
David Larrew, AIA, GDLA, GSRC
Architectural Technology Specialist
a r c h i S O L U T I O N S
WIN7-10/ OSX 10.15.7
AC 5.1-25 USA
Architectural Technology Specialist
a r c h i S O L U T I O N S
WIN7-10/ OSX 10.15.7
AC 5.1-25 USA
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-15 01:02 PM
‎2003-11-15
01:02 PM
Aussie John,
You puzzled me. You said you want to insert a dimension value into a string, did you?
Well, we know the type of a dimension value is numeric and all string function can not deal with numeric type value. So, I think you have to convert the value into a string type first, then you can do what you want.
You puzzled me. You said you want to insert a dimension value into a string, did you?
Well, we know the type of a dimension value is numeric and all string function can not deal with numeric type value. So, I think you have to convert the value into a string type first, then you can do what you want.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-16 01:21 AM
‎2003-11-16
01:21 AM
i have two numerical values say A & B. I want a text string to say "AxBmm". I think David suggestion will work. (I was too tired on friday to make any sense of the manual at that point!!)
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2003-11-16 02:38 AM
‎2003-11-16
02:38 AM
Try
text_dim = str(a*1000,3,0) + 'x' + str(b*1000,3,0) + 'mm'
if a = 500 and b = 380 you will get
500x380mm
The *1000 is important or you will be 3 decimal places out.
if you want spaces put then in ' x ' and ' mm'
I do this all the time. I have a little subroutine that draws a line with ticks to match my normal dims.
text_dim = str(a*1000,3,0) + 'x' + str(b*1000,3,0) + 'mm'
if a = 500 and b = 380 you will get
500x380mm
The *1000 is important or you will be 3 decimal places out.
if you want spaces put then in ' x ' and ' mm'
I do this all the time. I have a little subroutine that draws a line with ticks to match my normal dims.