cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

2DScript error with GDL DATA INPUT variable inside PARAGRAPH

Anonymous
Not applicable
I have created a label that will show flat name(via "Zone_relations" where zone number is flat name, though ID would be more suitable in this case but it's the limitation of the "Zone_relations" request), area etc and this is obtained through GDL DATA I/O ADD-ON by INPUT command that queries the database based on the key value.

1) The problem lies with one DATA INPUT variable (nr_rooms) that causes 2D Script error inside paragraph. At the same time there is another exactly identical input variable(unit_area) just from another channel/file and it works just fine. With print or TEXT2 command the problematic variable gives correct feedback but not when inside the paragraph. This is my first script so I assume it's something simple that I'm not aware of.

Master script:

rr1 = REQUEST ("Zone_relations", "", category_name, code, z_name, z_number)

identify = ""

key=z_number
ch1 = OPEN ("DATA", "KRT.txt", "SEPARATOR = '\t', MODE = RO, LIBRARY ")
ch2 = OPEN ("DATA", "KRT-toad.txt", "SEPARATOR = '\t', MODE = RO, LIBRARY ")
n = INPUT (ch1, key, 1, unit_area)
	if n <> 0 then
		identify = z_number
	else
		identify = Unit_ID
		key = Unit_ID
		n = INPUT (ch1, key, 1, unit_area)
	EndIF
nr = INPUT (ch2, key, 1, nr_rooms)
close ch1
close ch2
2D Script:

Font=LABEL_FONT_NAME
Font_size=fsize
Font_style=Detail_font_style
alignment=LABEL_TEXT_ALIGN
firstline_indent=0
left_indent=0
right_indent=0
line_spacing=LABEL_TEXT_LEADING

textblock_width=0
textblock_anchor=1
textblock_angel=0
textblock_width_factor=LABEL_TEXT_WIDTH_FACT
textblock_charspace_factor=LABEL_TEXT_CHARSPACE_FACT
textblock_fixed_height=1

DEFINE STYLE{2} "TypeLabel" Font, LABEL_TEXT_SIZE, LABEL_FONT_STYLE
DEFINE STYLE{2} "TypeDetail" Font, Font_size, Font_style

PARAGRAPH "Unit_ID" alignment,
  firstline_indent, left_indent, right_indent, line_spacing
  SET STYLE "TypeLabel"
  identify + ""
  ENDPARAGRAPH

PARAGRAPH "Details" alignment,
  firstline_indent, left_indent, right_indent, line_spacing
  SET STYLE "TypeDetail"
  nr_rooms + "-TOALINE\n"
  unit_area + " m²"
  ENDPARAGRAPH

TEXTBLOCK "Label" textblock_width, textblock_anchor, textblock_angel,
  textblock_width_factor, textblock_charspace_factor, textblock_fixed_height,
  "Unit_ID","Details"

RICHTEXT2 0,0, "Label"

Print nr, identify, nr_rooms, unit_area
2) And also, is there any way to automatically write lists or schedules? At the moment I'm forced to manually save the schedules as tabbed text files to retrieve data into the label object.

3) I have also been experimenting with GDL DATA I/O ADD-ON to OUTPUT the measured areas from zones with custom zone stamp and sum them up based on zone ID with label object script but I haven't succeeded because I wasn't able to fix on what was the trigger to execute the OUTPUT command. Of course this would be preferable approach because it wouldn't require schedules and manually saving them so any help in this field would be also much appreciated.
3 REPLIES 3
Anonymous
Not applicable
Similar problems have been discussed before:

http://archicad-talk.graphisoft.com/viewtopic.php?t=20132

It seems that the Paragraph text does not work quite as it should

Anssi
Anonymous
Not applicable
Anssi wrote:
Similar problems have been discussed before:

http://archicad-talk.graphisoft.com/viewtopic.php?t=20132

It seems that the Paragraph text does not work quite as it should

Anssi
I am aware of that topic but I just can't see the solution there for the conflict I have besides the null string?

Thanks
Anonymous
Not applicable
I'm getting some strange results. Script works only when requested value in a "KRT-toad.txt" file is number with comma or anything else. Plain number is not working... Exactly what I need. Way over my head!