We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Label

Anonymous
Not applicable
Hi! I tried to load a label to indicate a roof slope, from ArchiCAD GDL Object Depository but this error comes up.
any help will be appreciated
Thanks

Capture.JPG
3 REPLIES 3
rocorona
Booster
Hi, Giuseppe. the object was made by the user archibaldo, did you try to contact him?

I see there is more than one problem in that object, but is always difficult to say what is a choice and what has to be adjusted.

In the following script I modified very little things, so to get rid of the error message, hoping it still works in the intended way. Copy and paste it in the 2D Script of the downloaded object.
IF LABEL_ROTANGLE>90 AND LABEL_ROTANGLE<=280 THEN!  
MUL2 -1,-1 
ENDIF 
u=0 
 
SCALE = glob_scale/1000 
 
!FONT 
	define style "label" label_font_name,label_text_size*1.5,5,label_font_style 
	style "label" 
 
!CENTER POSITION 
	add2 label_position[2][1]+label_position[3][1], 
		 label_position[2][2]+label_position[3][2] 
 
 
!ARROW 
	ARROW_DIMENSION=ARROW_DIMENSION*SCALE 
	x = (stw(glob_ID)*SCALE)/2+ARROW_DIMENSION 
	y = (label_text_size*SCALE)/2+ARROW_DIMENSION 
	if txpos mod(3)=1 then dx=stw(glob_ID)*SCALE/2 
	if txpos mod(3)=0 then dx=-stw(glob_ID)*SCALE/2 
	if txpos<4 then dy=-(label_text_size*SCALE)/2 
	if txpos>6 then dy=(label_text_size*SCALE)/2 
 
!add2 dx-X,dy 
add2 labelQ,labelW 
	hotspot2 -labelQ,0,u+1,labelQ,1+128 
	hotspot2 0,0,u+2,labelQ,2 
	hotspot2 -labelQ-.001,0,u+3,labelQ,3 
	u=u+3 
	hotspot2 0,-labelW,u+1,labelW,1+128 
	hotspot2 0,0,u+2,labelW,2 
	hotspot2 0,-labelW-.001,u+3,labelW,3 
	u=u+3 
 
!	fill "EMPTY FILL" 
DEFINE EMPTY_FILL "lab" 
SET FILL "lab" 
 
K  =X/1.5 
QQ =Y/1.5 
poly2_b 6,7, 
  1,  LABEL_ARROWHEAD_PEN, 
  0,  -y,  2, 
  x,  y,   2, 
  x-K,y,   2, 
  0,  y-QQ,2, 
 -x+K,y,   2, 
 -x,  y,   2 
 
Tr=0 
IF LABEL_ROTANGLE>90 AND LABEL_ROTANGLE<=280 THEN!  
MUL2 1,-1  : tr=tr+1 
ADD2 0,-2*MTEXT/1.2 : tr=tr+1 
ENDIF 
 
TEXT2 0,MTEXT/1.2,STR(ROOF_ANGLE,3,0)+"°" 
 
HY = 3*label_text_size*glob_scale/1000 
 
labelQ = (stw(STR(ROOF_ANGLE,3,0)+"°"))*glob_scale/1000 
 
POLY2_b 4,7, 
   1,LABEL_ARROW_PEN, 
  -labelQ/2, -HY/3+MTEXT/1.2, 0, 
   labelQ/2, -HY/3+MTEXT/1.2, 0, 
   labelQ/2,  HY/3+MTEXT/1.2, 0, 
  -labelQ/2,  HY/3+MTEXT/1.2, 0 
 
HOTSPOT2 -labelQ/2,-HY/3+MTEXT/1.2 
HOTSPOT2  labelQ/2,-HY/3+MTEXT/1.2 
HOTSPOT2  labelQ/2, HY/3+MTEXT/1.2 
HOTSPOT2 -labelQ/2, HY/3+MTEXT/1.2 
 
IF FRAME THEN 
rect2  -labelQ/2,-HY/3+MTEXT/1.2,labelQ/2,HY/3+MTEXT/1.2 
ENDIF 
 
DEL 2+tr 
 
IF LABEL_ROTANGLE>90 AND LABEL_ROTANGLE<=280 THEN!  
MUL2 -1,-1 
ENDIF 
 
 
!ROT2 LABEL_ROTANGLE 
add2 labelX,labelY 
	hotspot2 -labelX,0,u+1,labelX,1+128 
	hotspot2 0,0,u+2,labelX,2 
	hotspot2 -labelX-.001,0,u+3,labelX,3 
	u=u+3 
	hotspot2 0,-labelY,u+1,labelY,1+128 
	hotspot2 0,0,u+2,labelY,2 
	hotspot2 0,-labelY-.001,u+3,labelY,3 
	u=u+3 
 
pen MAX(1,LABEL_TEXT_PEN)	 
 
	define style "label2" label_font_name,label_text_size,5,label_font_style 
	style "label2" 
HH=1.5*label_text_size*glob_scale/1000 
 
!IF LABEL_ROTANGLE>90 AND LABEL_ROTANGLE<=280 THEN 
!MUL2 -1,-1 
!ENDIF 
TEXT2 0,0,DENU+"_ S="+ STR(ROOF_TOP_SURF,4,2)+"mp" 
labelW=(stw(DENU+"_ S="+ STR(ROOF_TOP_SURF,4,2)+"mp")+1)*glob_scale/1000 
 
poly2_b 4,7, 
   1,LABEL_ARROW_PEN, 
  -labelW/2,-HH/2, 0, 
   labelW/2,-HH/2, 0, 
   labelW/2, HH/2, 0, 
  -labelW/2, HH/2, 0 
 
IF FRAME THEN 
  rect2 -labelW/2,-HH/2,labelW/2,HH/2 
 
  HOTSPOT2 -labelW/2,-HH/2 
  HOTSPOT2  labelW/2,-HH/2 
  HOTSPOT2  labelW/2,HH/2 
  HOTSPOT2 -labelW/2,HH/2 
endif 
 
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Roberto thank you so much for your for talking the time to answer my question and fix my part it has been a great help and time saving. You are the Michael Phelps of GDL.
Next time I am in Rome let go to have a dinner.
GRAZIE MILLE
rocorona
Booster
You are welcome
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________