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

Please Help. Building simple parametric formula

Anonymous
Not applicable
Please Help. Building simple parametric formula.

Hi guys.
I have a little challenge from my boss today.

Using GLD in archicad, I have to create a simple table of contents with 3 columns under each other, taking parametric information from the project info... project name... number and issue date.
but also, an option in the gdl, that I can turn off one or more of the parametric columns.

I really want to do a absolute simple 3 line columns as test and I know a pro could do this in 20 seconds.

But I would be very thankful if some one could show me how to do this or point me to a tutorial some where on the internet, where this is done.

I would love to be able to show my boss this evening a finished parametric date formula... 🙂

Please help.
Ian 🙂
6 REPLIES 6
rocorona
Booster
Said that it is NOT SO easy, 'coz you need to define the font size, font stile, column width and so on, a little sketch of the desired result would be of help.

You can start with this very basic 2D Script:

TEXT2 0, 0,"<PROJECTNAME>"
TEXT2 0, -.5,"<PROJECTNUMBER>"
TEXT2 0, -1,"<DATEOFISSUE>"
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Erwin Edel
Rockstar
I would use the layers in 2d symbol (16 possible layers, means 16 different bits of text).

Then set up some parameters with on/off button. For example: pinfo = projectinfo parameter

With this:
if pinfo = 1 then fragment2 5,1
you turn on layer 5

Check the GDL reference guide for more help on the fragment2 code.


Easier would be to just draw the stamp with text, save the view in your template and link the views as needed on master layouts. But maybe that's just how we work in our office.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
Anonymous
Not applicable
thanks guys.

I have tried to create a simple object on plan and then save it as a GDL object.

I added the perimeter in the GDL editor for text.size and also text.content, gave the two perimerters the correct function setting.

Then put the two function paremeters into the 2d code screen.
saved it out and tested. Now when i go into the object settings, i can change the text content no problem, but when i try and change the text size, nothing happens with the text, but the full symbol lines jump up the screen.

Here is the code.
What am I doing wrong ??




!
! Name : lego.gsm
! Datum : Montag, 11. März 2013
! Version : 15.00
! Geschrieben von ArchiCAD
!

mul2 A/4.517303, B/1.904131
add2 -1.974573827986, 3.52979304251
pen 1
hotspot2 2.502204948105, -3.359909358017
hotspot2 5.970700386989, -3.359909358017
hotspot2 4.236452667547, -1.625661638576
hotspot2 3.496560333429, -1.791415020666
hotspot2 4.236452667547, -3.359909358017
line_property 0
line2 2.502204948105, -3.359909358017, 5.970700386989, -3.359909358017
arc2 4.236452667547, -3.359909358017, 1.734247719442, 0, 180
define style{2} "AC_STYLE_1" "Arial", text_size, 0

paragraph "AC_PRG_18" 2, 0, 0, 0, 1
set style "AC_STYLE_1"
text_content
endparagraph
paragraph "AC_PRG_19" 2, 0, 0, 0, 1
""
endparagraph
paragraph "AC_PRG_20" 2, 0, 0, 0, 1
""
endparagraph
textblock "AC_TEXTBLOCK_12" 45.17302629029, 1, 0, 1, 1, 1,
"AC_PRG_18", "AC_PRG_19", "AC_PRG_20"
richtext2 1.974573827986, -2.35121304251, "AC_TEXTBLOCK_12"
Anonymous
Not applicable
I wanted to create also a simple tabel with 3 polyogn boxes as cells.
put text into the 3 cells and created the whole thing as 1 GDL object.
I have given each text perimeters to be changes. Now I want to make the size of the cell boxes also parametric.. where in the 2d GLD code, can I do that ?

Thanks.
Ian


!
! Name : croc.gsm
! Datum : Montag, 11. März 2013
! Version : 15.00
! Geschrieben von ArchiCAD
!

mul2 A/15.875092, B/1.140081
add2 -1.15217286815, 10.40127483584
pen 1
hotspot2 1.15217286815, -9.26119369613
hotspot2 6.443870233583, -9.26119369613
hotspot2 11.73556759902, -9.26119369613
hotspot2 17.02726496445, -9.26119369613
hotspot2 17.02726496445, -10.40127483584
hotspot2 11.73556759902, -10.40127483584
hotspot2 6.443870233583, -10.40127483584
hotspot2 1.15217286815, -10.40127483584
set fill "Nur Hintergrund-Stift"
poly2_b{5} 5, 3, 0, 3, 0, 0,
0, 0, 1, 0, 0, 1, 0,
6.443870233583, -9.26119369613, 1,
11.73556759902, -9.26119369613, 1,
11.73556759902, -10.40127483584, 1,
6.443870233583, -10.40127483584, 1,
6.443870233583, -9.26119369613, 1
set fill "Nur Hintergrund-Stift"
poly2_b{5} 5, 3, 0, 3, 0, 0,
0, 0, 1, 0, 0, 1, 0,
11.73556759902, -9.26119369613, 1,
17.02726496445, -9.26119369613, 1,
17.02726496445, -10.40127483584, 1,
11.73556759902, -10.40127483584, 1,
11.73556759902, -9.26119369613, 1
set fill "Nur Hintergrund-Stift"
poly2_b{5} 5, 3, 0, 3, 0, 0,
0, 0, 1, 0, 0, 1, 0,
1.15217286815, -9.26119369613, 1,
6.443870233583, -9.26119369613, 1,
6.443870233583, -10.40127483584, 1,
1.15217286815, -10.40127483584, 1,
1.15217286815, -9.26119369613, 1
define style{2} "AC_STYLE_1" "ISOCPEUR", 2, 1

paragraph "AC_PRG_32" 2, 0, 0, 0, 1
set style "AC_STYLE_1"
project_name
endparagraph
textblock "AC_TEXTBLOCK_24" 40.26852629305, 1, 0, 1, 1, 1,
"AC_PRG_32"
richtext2 1.964248564834, -9.751709887674, "AC_TEXTBLOCK_24"

paragraph "AC_PRG_33" 2, 0, 0, 0, 1
project_number
endparagraph
textblock "AC_TEXTBLOCK_25" 39.80388945121, 1, 0, 1, 1, 1,
"AC_PRG_33"
richtext2 7.221169870345, -9.723745633303, "AC_TEXTBLOCK_25"

paragraph "AC_PRG_34" 2, 0, 0, 0, 1
locations
endparagraph
textblock "AC_TEXTBLOCK_26" 34.53800524366, 1, 0, 1, 1, 1,
"AC_PRG_34"
richtext2 12.98838613801, -9.746534088377, "AC_TEXTBLOCK_26"
rocorona
Booster
pixpast wrote:
tried to create a simple object on plan and then save it as a GDL object.

...

Here is the code.
What am I doing wrong ??
I do not recommend using this procedure, because it results in a over-complex script. I can also see your text block has three rows (one with thew actual text and two empty)


So said, when I copied it and tested the object, it works almost as expected. Changing text_size parameter result in a increased or decreased text size. It don't stay centered in the frame, but this is normal.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
rocorona
Booster
Writing our own scripts is difficult, at the beginning, but is far more simple than trying to change autoscripted objects.

Do a try to this code:
DEFINE STYLE "st1" font, text_size, 5, 0
SET STYLE st1

LINE2 -a/2, 0, a/2, 0
ARC2 0, 0, a/2, 0, 180

HOTSPOT2  0,   0, 1
HOTSPOT2 -a/2, 0, 2
HOTSPOT2  a/2, 0, 3
HOTSPOT2  0, a/2, 4

TEXT2 0, (a/2)*.4, text_content
it uses 3 parameters:
text_content, text_size, font
_________________

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