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

zone tag used as room tag

Anonymous
Not applicable
We got htis room tag from Eric Batte and I wanted to add something to the code for 3 lines for a room name. It currently has 2 lines for the room tag. here is the script from the master script:

len = strlen(ROOM_NAME)
breaker = strstr(ROOM_NAME," ")
RN = strsub(ROOM_NAME,1,breaker-1)
KN = strsub(ROOM_NAME,breaker+1,len)

and here's some of the code form the 2d:

middle = max_len/2

vlen = - shight

rot2 w
add2 -max_len/2, vlen - max_h/2

if name then
if KN<>"*" THEN
Text2 middle,-vlen, KN
endif

IF KN="*" THEN
Text2 middle,-vlen, RN
ELSE
Text2 middle,2*(-vlen), RN
ENDIF
ENDIF

How do I add another line of text?

Thanks for any help,
Michele
4 REPLIES 4
Anonymous
Not applicable
Need a little more of the script to help like how KN gets the value of "*", maybe in the master script or at the start of the 2D script? if the script is not copywrited can you post entire script. Otherwise just PM Eric directly, username: Eric Batte.
Anonymous
Not applicable
Here is the entire 2d script and I sent the entire master script in the last email.

define style "idestyle" fonttype , ROOM_LSIZE , 2, 1
define style "idestyle2" fonttype , ROOM_LSIZE , 8, 1

mul2 A_/1000,A_/1000
style idestyle
rrr=request("Height_of_style","idestyle", shight)

catname = ""
catcode = ""
rrr=request("Zone_category", "", catname, catcode)
Zname = ROOM_NAME
if cn_zn then Zname = catname !*** display Category Name as Zone name
if catcode = "0" then Zname = "Gross Area" !***prints "BGF" to the stamp

area_form=""
rrr=request ("Area_dimension","",area_form)
room_area = str (area_form, ROOM_CALC_AREA)
lin_form=""
rrr=request ("Linear_dimension","",lin_form)
room_height = str (lin_form , ROOM_HEIGHT)
room_perim = str (lin_form , ROOM_PERIM)

unit = ""
area_unit = ""
lin_unit = ""
form = ""

form = lin_form !*** Unit strings
gosub 1001
lin_unit = unit

form = area_form
gosub 1002
area_unit = unit

room_area = room_area + area_unit !*** composite strings
if ceil_h then room_height = "H: typical" else room_height = "H: " + room_height + lin_unit
room_perim = "P: " + room_perim + lin_unit
code_string = basec + " " + wallc + " " + ceilc

!w_roona = (stw (Zname)) * name !*** width of the strings - 0 if not displayed
w_roonu = (stw (ROOM_NUMBER)+3) * num
w_codes = stw (code_string)+3 * code
w_rooar = (stw (room_area)+3) * area
w_peri = (stw (room_perim)+3) * peri
w_roohe = (stw (room_height)+3) * ceil_s
max_len= max (w_roonu, w_codes, w_rooar, w_peri, w_roohe)
max_h = - (name + num + code + area + peri + ceil_s) * shight

middle = max_len/2

vlen = - shight

rot2 w
add2 -max_len/2, vlen - max_h/2

if name then
if KN<>"*" THEN
Text2 middle,-vlen, KN
endif
IF KN="*" THEN
Text2 middle,-vlen, RN
ELSE
Text2 middle,2*(-vlen), RN
ENDIF
ENDIF

if num then
n=n+1
vlen =vlen + shight
Text2 middle,-vlen, ROOM_NUMBER
endif
if area then
n=n+1
vlen =vlen + shight
Text2 middle, -vlen, room_area
endif
if code then
n=n+1
vlen =vlen + shight
Text2 middle,-vlen, code_string
endif
if peri then
n=n+1
vlen =vlen + shight
Text2 middle,-vlen, room_perim
endif
if ceil_s then
n=n+1
vlen =vlen + shight
Text2 middle,-vlen, room_height
endif

vlen = vlen+shight

! hotspot2 0, shight
! hotspot2 max_len, shight
! hotspot2 0, max_h + shight
! hotspot2 max_len, max_h + shight
! hotspot2 max_len/2, max_h/2 + shight
if hspots then
! hotspot2 max_len/2, -shight/2
! hotspot2 max_len/2, -i*shight
! hotspot2 0, max_h/2 + shight
! hotspot2 max_len, max_h/2 + shight
endif

if box_y and n then
pen Pen_Box
line2 0 , 0, 0, -vlen
line2 max_len , 0, max_len , -vlen
for i=0 to n
line2 0,-i*shight, max_len, -i*shight
hotspot2 0, -i*shight
hotspot2 max_len, -i*shight
hotspot2 max_len/2, -i*shight
next i
endif

end

1001: !*** Linear unit strings

if strstr (form, "m") then unit = " m"
if strstr (form, "cm") then unit = " cm"
if strstr (form, "mm") then unit = " mm"
if strstr (form, "i") or strstr (form, "f") then unit = ""

return

1002: !*** Area unit strings

if strstr (form, "sqm") then unit = " m2"
if strstr (form, "sqcm") then unit = " cm2"
if strstr (form, "sqmm") then unit = " mm2"
if strstr (form, "sqmm") then unit = " mm2"
if strstr (form, "sqf") then unit = " SF"
if strstr (form, "sqi") then unit = " sq inch"

return



Thanks,
Michele
Anonymous
Not applicable
Michele, is there a parameter script, still cant find where the value of KN is defined with a "*"
Anonymous
Not applicable
There is no parameter script. Could it have benn hidden in the code? Does "*" mean anything in GDL code?

Thanks for all your help and time looking at the code,
Michele