In Archicad:
1.) File -> GDL Objects -> New Object
2.) Save the File
3.) Commands will go under 2D Script inside the GDL object
An example of the code under 2D Script:
PEN 7
LINE2 1', 1', -1', 1'
LINE2 -1', 1', -1', -1'
LINE2 -1', -1', 1', -1'
LINE2 1', -1', 1', 1'
DEFINE STYLE "AC_STYLE_1" "ARchitxt Western",
7'-9.7500", 5, 0
SET STYLE "AC_STYLE_1"
TEXT2 0', 0', "W"