Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

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

help with text code

Anonymous
Not applicable
Here is code in an object and I can't get the text to show up. I copied the code from another object where the text works just fine. I added dd_x and dd_y to the parameters. Can anyone tell from the my code what I did wrong?? Thanks in advance,

Michele



1100: !square
PEN gs_cont_pen
RECT2 0,0,a_size,b_size
PEN 91
DEFINE STYLE STYLE_12 "Arial", 35 * MIN (a, b), 7, 2

!!!!!THis is moveable text hotspot and text for more_text

STYLE STYLE_12
PEN cpen
rot2 -symb_rotangle!!This rotate text to follow object
unID = 1

HOTSPOT2 0, dd_y,unID, dd_x,1+128 : unID=unID+1!!!THis is moveable hotspot placement
HOTSPOT2 -1, dd_y,unID, dd_x,3 : unID=unID+1
HOTSPOT2 dd_x,dd_y,unID, dd_x,2 : unID=unID+1

HOTSPOT2 dd_x, 0,unID, dd_y,1+128 : unID=unID+1
HOTSPOT2 dd_x, -1,unID, dd_y,3 : unID=unID+1
HOTSPOT2 dd_x,dd_y,unID, dd_y,2 : unID=unID+1

ADD2 dd_x, dd_y
TEXT2 0", 0",(descrip_equip)!!the 0",0" is text hotspot placement
DEL 2


PEN pen_clear
SET LINE_TYPE "TRI Demolition"
SET FILL "Air Space" !1' is a_size 2' is b_size
POLY2_B{2} 5, 3, 0, 0,
0'-0.0000", 0'-0.0000", 0'-0.0000",
0'-0.0000"-left, 0'-0.0000"-bottom_, 1,
a_size + right, 0'-0.0000"-bottom_, 1,
a_size+right, b_size+top_, 1,
0'-0.0000"-left, b_size+top_, 1,
0'-0.0000"-left, 0'-0.0000"-bottom_, 1
RETURN
12 REPLIES 12
TomWaltz
Participant
Do you define "descrip_equip" somewhere, like in the Parameter List? That's what TEXT2 is trying to place and does not have a value.

Also, is subroutine 1100 being called from somewhere? Otherwise the code you have here will not run at all.
Tom Waltz
Anonymous
Not applicable
Yes and yes.
I even get the green hotspot for the text like I do in my other object but no text. I zoomed extents in an empty file and still no text displayed.

So the code looks fine as long as I'm adding parameters and I'm calling the sub routine?

Any other ideas??!!
Michele
TomWaltz
Participant
Is text STYLE_12 defined? Maybe it's too small?

Also, try replacing the variable with a literal, like "My Text" (with quotes) to see if it's the variable or if it's the text settings.
Tom Waltz
Anonymous
Not applicable
If you look in the code I added to the original post it does define the style. And I tried changing the variable to "my text" with no luck


Thanks again,
Michele
Anonymous
Not applicable
I just neede to fix the size of my text. It worked in the last object but I must of had other code that made it work.

Thanks for helping,
Michele
Anonymous
Not applicable
Another question,

I want the text to be underneath the object. I kind of want the text to show up only for my benefit and not be printed. I have it on the 91 color but it looks like it will cover up my object in parts!

Thanks,
Michele
TomWaltz
Participant
Michele wrote:
If you look in the code I added to the original post it does define the style. And I tried changing the variable to "my text" with no luck


Thanks again,
Michele
Oops, sorry!
Tom Waltz
TomWaltz
Participant
Michele wrote:
Another question,

I want the text to be underneath the object. I kind of want the text to show up only for my benefit and not be printed. I have it on the 91 color but it looks like it will cover up my object in parts!

Thanks,
Michele
Technically there is no such thing as "non-printing" in Archicad. There is only "prints white so you cannot see it", but sometimes that covers other things 😞
Tom Waltz
Anonymous
Not applicable
Okay, I thought I'd make the text moveable so if it is ON the object then you can move it. What the HECK is wrong with my code. It worked jsut fine in my other project (I know there probably was other code) Does anyone know why it isn't working? I thought I copied over everything that I needed. THe text shows up and I see the moveable hotspot. I even get the box that comes up showing me that the text is moving but in the end the text stays put.

Thanks again,
Michele

Here's all the code in 2D


HOTSPOT2 0,0
HOTSPOT2 a_size,0
HOTSPOT2 a_size/2,0 !down
HOTSPOT2 a_size,b_size
HOTSPOT2 0,b_size


!hotspot @ clearances

HOTSPOT2 0'-0.0000"-left, 0'-0.0000"-bottom_
HOTSPOT2 a_size + right, 0'-0.0000"-bottom_
HOTSPOT2 a_size+right, b_size+top_
HOTSPOT2 0'-0.0000"-left, b_size+top_
HOTSPOT2 0'-0.0000"-left, 0'-0.0000"-bottom_






PEN gs_cont_pen
RECT2 0,0,a_size,b_size
PEN 91
DEFINE STYLE STYLE_12 "Arial", text_size, 7, 6

!!!!!THis is moveable text hotspot and text for descrip_equip
STYLE STYLE_12
PEN 91
rot2 -symb_rotangle!!This rotate text to follow object
unID = 1

HOTSPOT2 0, dd_y,unID, dd_x,1+128 : unID=unID+1!!!THis is moveable hotspot placement
HOTSPOT2 -1, dd_y,unID, dd_x,3 : unID=unID+1
HOTSPOT2 dd_x,dd_y,unID, dd_x,2 : unID=unID+1

HOTSPOT2 dd_x, 0,unID, dd_y,1+128 : unID=unID+1
HOTSPOT2 dd_x, -1,unID, dd_y,3 : unID=unID+1
HOTSPOT2 dd_x,dd_y,unID, dd_y,2 : unID=unID+1

ADD2 dd_x, dd_y
TEXT2 3", 3",(descrip_equip)!!the 0",0" is text hotspot placement
DEL 2



PEN pen_clear
SET LINE_TYPE "TRI Demolition"
SET FILL "Air Space" !1' is a_size 2' is b_size
POLY2_B{2} 5, 3, 0, 0,
0'-0.0000", 0'-0.0000", 0'-0.0000",
0'-0.0000"-left, 0'-0.0000"-bottom_, 1,
a_size + right, 0'-0.0000"-bottom_, 1,
a_size+right, b_size+top_, 1,
0'-0.0000"-left, b_size+top_, 1,
0'-0.0000"-left, 0'-0.0000"-bottom_, 1