Text treatment in GDL
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-07 07:45 PM
‎2004-10-07
07:45 PM
I'm trying to create a block with multiple lines of text, and I wouldn't always need all the lines of text to show all the time. One option that I thought I saw here, was to move the second line of text down by the height of the text (i.e.: if the text is 5mm high, the second line would start 6mm below it). I just can't remember how you can pull (REQUEST?) that information out.
Alternately, is there a line-feed option that I'm not aware of?
Thanx
8 REPLIES 8
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-07 09:37 PM
‎2004-10-07
09:37 PM
The text height is in your style definition. I often use a variable for this like text_sz so I can call it later in situations like yours.
There is no linefeed function. You have to insert lines of text with separate TEXT2 statements. I have set up parts to word wrap to a variable column width, but this requires parsing the strings and assigning each line of text to a separate variable. This is not a job for the faint of heart or short of time.
There is no linefeed function. You have to insert lines of text with separate TEXT2 statements. I have set up parts to word wrap to a variable column width, but this requires parsing the strings and assigning each line of text to a separate variable. This is not a job for the faint of heart or short of time.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-08 12:02 AM
‎2004-10-08
12:02 AM
I also use a text size variable, however, how would you figure out where to place the next line of text? For example:
Y = 0-text_size , can you?
text_size = 5 !-- this is usually in mm, right? TEXT 0", 0", "first line of text here" TEXT 0", Y, "second line of text here"How would you figure out what 'Y' should be if you're working in the english system? You can't just do
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-08 12:15 AM
‎2004-10-08
12:15 AM
Sergio wrote:Sure. An example:
I also use a text size variable, however, how would you figure out where to place the next line of text? For example:
text_size = 5 !-- this is usually in mm, right? TEXT 0", 0", "first line of text here" TEXT 0", Y, "second line of text here"How would you figure out what 'Y' should be if you're working in the english system? You can't just doY = 0-text_size, can you?
text_sz = 8 * 0.3528 ! conversion from points to mm DEFINE STYLE "text_style" "Arial", text_sz, 1, 0 STYLE text_style TEXT2 0, 0, "First line of text" ! or a variable parameter TEXT2 0, -text_sz*1.25, "Second line of text" ! or whatever
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-08 01:37 AM
‎2004-10-08
01:37 AM
Huh? Did I mention I'm on the english system (the one with feet and inches)?
I just tried your solution, and I'm still getting some weird spacing. My temporary solution is like so:

t_lines=0 t_conv=0.08 a2 = a IF s_dim = 1 THEN !--- show Dimmer --- dim_a = a2: dim_b = b+(t_lines*t_size*t_conv) hotspot2 dim_a, dim_b, 2 !drag text to location TEXT2 dim_a, dim_b, 'D' t_lines = t_lines +1 ENDIFI'll probably take another look at it some other time... unless you have some other ideas. Maybe I'm just not seeing it (wouldn't be the first time).
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-08 04:14 AM
‎2004-10-08
04:14 AM
Sorry, I forgot one important thing. The text size is mm in paper space but the TEXT2 position parameters assume meters in model space (like all of GDL internally), so the line should read:
In any case, GDL is all metric internally but you can always put in the arithmetic to do the conversion. When you type in the foot-inch format in GDL scripts it is converted for you.
I honestly don't understand what you are trying to accomplish with the code you posted. It looks a bit complicated if all you are trying to do is place multiple lines of text.
TEXT2 0, -text_sz*A_*0.00125, "Second line of text"When you say you are using imperial/english/american, I am assuming that means you are using point sizes for type.
In any case, GDL is all metric internally but you can always put in the arithmetic to do the conversion. When you type in the foot-inch format in GDL scripts it is converted for you.
I honestly don't understand what you are trying to accomplish with the code you posted. It looks a bit complicated if all you are trying to do is place multiple lines of text.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-08 05:12 AM
‎2004-10-08
05:12 AM
Matthew wrote:
Sorry, I forgot one important thing...
Okay, much better now. Thank you very much...

I honestly don't understand what you are trying to accomplish with the code you posted. It looks a bit complicated if all you are trying to do is place multiple lines of text.
I was actually trying to create some blocks (switch, outlet, etc) that would need to have different parameters show up (height AFF, dimmer, 3W, etc). Sometimes you need to have more than one option showing, hence the need for a second line. Now if only I could figure out a way of having the option to position the hotlinks (and associated text) individually for all... Any ideas here?
As for the code, I'm not generally known for creating very clean code.



Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-08 06:49 AM
‎2004-10-08
06:49 AM
Matthew wrote:Matthew, you will be pleased to know you are incorrect
There is no linefeed function. You have to insert lines of text with separate TEXT2 statements.
use +"\n" to make a new line of text
Example:
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
‎2004-10-08 09:40 AM
‎2004-10-08
09:40 AM
Aussie wrote:Cool. Thanks.Matthew wrote:Matthew, you will be pleased to know you are incorrect
There is no linefeed function. You have to insert lines of text with separate TEXT2 statements.
use +"\n" to make a new line of text
Example:text2 L,H,"max width "+x+" m"+"\n"+"max depth "+y+" m"+"\n"+area+" sq m"