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

GDL
About building parametric objects with GDL.
SOLVED!

Custom drawing title

Ahmed_K
Advisor

Hello , 

Creating custom drawings does not support back referencing, 

the defaut Archicad linear drawing title object support back reference, but i don't know why  this object is designed to show titles and scales on the right of the drawing, 

i know it can be adjusted inside the GDL editor, but i didn't figure it out, i tried but with no results, 

Can someone help me to obtain that result by editing an existing drawing title GDL script ?

Thanks

Archicad_ENPqaogVtu.png

AMD Ryzen 9 3900X, 32 GB RAM, RTX 3080 10 GB
Archicad 27
Windows 11 professional
https://www.behance.net/Nuance-Architects
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
AllanP
Advocate

Hi bouhmidage ,

your one is is how titles are meant to look, i don't know why there isn't a standard one like that...

Note:

Best method to get what you want is to save what you have typed as an object,

and it will turn it into code with everything in the correct position as code.

 

then open the code and substitute the code below where needed to get back ref and drawing information.

 

 

to get it to work it requires coding;

AllanP_0-1672712554655.png

from an older version of the drawing title:

if gs_backref_custom=0 then


STYLE styleBackref
pen gs_backref_font_pen


TEXT2 posX+ gs_backref_pos_x,-backrefFontH+gs_backref_pos_y,gs_backref_prefix+"<BACKREFSHEETNUMBER_R><DUMMY><"+ gs_backref_separator + ">" + AC_BackReferenceGUIDList[1]
else

set style "styleBackref"
pen gs_backref_font_pen
TEXT2 posX+ gs_backref_pos_x ,-titleHeight+gs_backref_pos_y,gs_backref_prefix+gs_backref_customtxt
endif

(Note: the AC_BackReferenceGUIDList array produces ID of the drawings so it can calulate the page the backrefence is on, you need lots of extra parameters in the parameters script for this to work)

AllanP_1-1672713042183.png

to get the drawing name and number in code then

drawingNumber = gs_drawing_number_prefix + AC_DrawingNumber
text2 posX + gs_drawing_number_pos_x, posY + gs_drawing_number_pos_y, drawingNumber

drawingName = AC_DrawingName
text2 posX + gs_drawing_name_pos_x, posY + gs_drawing_name_pos_y, drawingName

 

(Note: the AC_DrawingNumber and AC_DrawingName parameters need to be in the parameters script for this to work)

AllanP_2-1672713383388.png

 

if gs_drawing_scale_original then
drawingScale = gs_drawing_scale_prefix + AC_OriginalDrawingScale
else
drawingScale = gs_drawing_scale_prefix + AC_DrawingScale
endif

text2 posX + gs_drawing_scale_pos_x, posY + gs_drawing_scale_pos_y, drawingScale

(Note: the AC_OriginalDrawingScale and AC_DrawingName parameters need to be in the parameters script for this to work)

 

you would need a circle,

AllanP_3-1672713528669.png

you will need a line

AllanP_4-1672713558570.png

and you will need to set anchor points to the text

AllanP_5-1672713853176.png

 

 

the code  that Archicad produces will look like this.
the anchor points i will make bold, in the textblock part of the script:

!
! Name : New Object 5.gsm
! Date : Tuesday, 3 January 2023
! Version : 18.00
! Written by Archicad
!

mul2 A/0.072811, B/0.009130
add2 0.01130368226451, 0.004565182264512
pen penAttribute_1
line_property 0
line2 -0.009130364529023, 0, 0.06150720974114, 0
pen penAttribute_2
circle2 -0.004565182264512, 0, 0.004565182264512
define style{2} "AC_STYLE_1" "Arial", 2, 0

paragraph "AC_PRG_21" 2, 0, 0, 0, 1
set style "AC_STYLE_1"
"Drawing name aligned to the left"
endparagraph
textblock "AC_TEXTBLOCK_21" 0, 7, 0, 1, 1, 1,
"AC_PRG_21"
richtext2 0, 0, "AC_TEXTBLOCK_21"

paragraph "AC_PRG_22" 2, 0, 0, 0, 1
"Drawing Scale aligned to the left"
endparagraph
textblock "AC_TEXTBLOCK_22" 0, 1, 0, 1, 1, 1,
"AC_PRG_22"
richtext2 0, -3.788908032329E-008, "AC_TEXTBLOCK_22"

paragraph "AC_PRG_23" 2, 0, 0, 0, 1
"Drawing ID"
endparagraph
textblock "AC_TEXTBLOCK_23" 0, 8, 0, 1, 1, 1,
"AC_PRG_23"
richtext2 -0.004565182264512, 0, "AC_TEXTBLOCK_23"

paragraph "AC_PRG_24" 2, 0, 0, 0, 1
"Back Ref"
endparagraph
textblock "AC_TEXTBLOCK_24" 0, 2, 0, 1, 1, 1,
"AC_PRG_24"
richtext2 -0.004565182264512, 0, "AC_TEXTBLOCK_24"

take a working drawing title, save as, delete the 2d content...

then use the following code (cleaned up so you can read it)  in the 2d script of your new drawing title:

 

line2 -0.005, 0, 0.065, 0
circle2 0, 0, 0.005


define style{2} "Arial_STYLE_2mm" "Arial", 2, 0!!!2mm Arial text....you can change this,



set style "Arial_STYLE_2mm"

paragraph "Drawing name Paragraph" 2, 0, 0, 0, 1
AC_DrawingName !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"Drawing name aligned to the left"
endparagraph
textblock "Drawing name TEXTBLOCK" 0, 7, 0, 1, 1, 1,
"Drawing name Paragraph"
richtext2 0.005, 0, "Drawing name TEXTBLOCK"



paragraph "Drawing scale Paragraph" 2, 0, 0, 0, 1
AC_OriginalDrawingScale !!!!!!!!!!!!!!!!"Drawing Scale aligned to the left"
endparagraph
textblock "Drawing scale TEXTBLOCK" 0, 1, 0, 1, 1, 1,
"Drawing scale Paragraph"
richtext2 0.005, 0, "Drawing scale TEXTBLOCK"



paragraph "Drawing ID Paragraph" 2, 0, 0, 0, 1
AC_DrawingNumber !!!!!!!!!!!!!!!!!!"Drawing ID"
endparagraph
textblock "Drawing ID TEXTBLOCK" 0, 8, 0, 1, 1, 1,
"Drawing ID Paragraph"
richtext2 0, 0, "Drawing ID TEXTBLOCK"

paragraph "Back Ref Paragraph" 2, 0, 0, 0, 1
"<BACKREFSHEETNUMBER_R><DUMMY><.>" + AC_BackReferenceGUIDList[1] !!!!!!!!!!!!!!!!!!!!!!!!!!"Back Ref"
endparagraph
textblock "Back Ref TEXTBLOCK" 0, 2, 0, 1, 1, 1,
"Back Ref Paragraph"
richtext2 0, 0, "Back Ref TEXTBLOCK"

and you have your title you wanted.

 

 

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 27
Member of Architalk since 2003, but missed the migration to Graphisoft.
(where have all my original posts gone?)

View solution in original post

6 REPLIES 6
Ahmed_K
Advisor

bouhmidage_0-1671792926928.png

 

AMD Ryzen 9 3900X, 32 GB RAM, RTX 3080 10 GB
Archicad 27
Windows 11 professional
https://www.behance.net/Nuance-Architects
Solution
AllanP
Advocate

Hi bouhmidage ,

your one is is how titles are meant to look, i don't know why there isn't a standard one like that...

Note:

Best method to get what you want is to save what you have typed as an object,

and it will turn it into code with everything in the correct position as code.

 

then open the code and substitute the code below where needed to get back ref and drawing information.

 

 

to get it to work it requires coding;

AllanP_0-1672712554655.png

from an older version of the drawing title:

if gs_backref_custom=0 then


STYLE styleBackref
pen gs_backref_font_pen


TEXT2 posX+ gs_backref_pos_x,-backrefFontH+gs_backref_pos_y,gs_backref_prefix+"<BACKREFSHEETNUMBER_R><DUMMY><"+ gs_backref_separator + ">" + AC_BackReferenceGUIDList[1]
else

set style "styleBackref"
pen gs_backref_font_pen
TEXT2 posX+ gs_backref_pos_x ,-titleHeight+gs_backref_pos_y,gs_backref_prefix+gs_backref_customtxt
endif

(Note: the AC_BackReferenceGUIDList array produces ID of the drawings so it can calulate the page the backrefence is on, you need lots of extra parameters in the parameters script for this to work)

AllanP_1-1672713042183.png

to get the drawing name and number in code then

drawingNumber = gs_drawing_number_prefix + AC_DrawingNumber
text2 posX + gs_drawing_number_pos_x, posY + gs_drawing_number_pos_y, drawingNumber

drawingName = AC_DrawingName
text2 posX + gs_drawing_name_pos_x, posY + gs_drawing_name_pos_y, drawingName

 

(Note: the AC_DrawingNumber and AC_DrawingName parameters need to be in the parameters script for this to work)

AllanP_2-1672713383388.png

 

if gs_drawing_scale_original then
drawingScale = gs_drawing_scale_prefix + AC_OriginalDrawingScale
else
drawingScale = gs_drawing_scale_prefix + AC_DrawingScale
endif

text2 posX + gs_drawing_scale_pos_x, posY + gs_drawing_scale_pos_y, drawingScale

(Note: the AC_OriginalDrawingScale and AC_DrawingName parameters need to be in the parameters script for this to work)

 

you would need a circle,

AllanP_3-1672713528669.png

you will need a line

AllanP_4-1672713558570.png

and you will need to set anchor points to the text

AllanP_5-1672713853176.png

 

 

the code  that Archicad produces will look like this.
the anchor points i will make bold, in the textblock part of the script:

!
! Name : New Object 5.gsm
! Date : Tuesday, 3 January 2023
! Version : 18.00
! Written by Archicad
!

mul2 A/0.072811, B/0.009130
add2 0.01130368226451, 0.004565182264512
pen penAttribute_1
line_property 0
line2 -0.009130364529023, 0, 0.06150720974114, 0
pen penAttribute_2
circle2 -0.004565182264512, 0, 0.004565182264512
define style{2} "AC_STYLE_1" "Arial", 2, 0

paragraph "AC_PRG_21" 2, 0, 0, 0, 1
set style "AC_STYLE_1"
"Drawing name aligned to the left"
endparagraph
textblock "AC_TEXTBLOCK_21" 0, 7, 0, 1, 1, 1,
"AC_PRG_21"
richtext2 0, 0, "AC_TEXTBLOCK_21"

paragraph "AC_PRG_22" 2, 0, 0, 0, 1
"Drawing Scale aligned to the left"
endparagraph
textblock "AC_TEXTBLOCK_22" 0, 1, 0, 1, 1, 1,
"AC_PRG_22"
richtext2 0, -3.788908032329E-008, "AC_TEXTBLOCK_22"

paragraph "AC_PRG_23" 2, 0, 0, 0, 1
"Drawing ID"
endparagraph
textblock "AC_TEXTBLOCK_23" 0, 8, 0, 1, 1, 1,
"AC_PRG_23"
richtext2 -0.004565182264512, 0, "AC_TEXTBLOCK_23"

paragraph "AC_PRG_24" 2, 0, 0, 0, 1
"Back Ref"
endparagraph
textblock "AC_TEXTBLOCK_24" 0, 2, 0, 1, 1, 1,
"AC_PRG_24"
richtext2 -0.004565182264512, 0, "AC_TEXTBLOCK_24"

take a working drawing title, save as, delete the 2d content...

then use the following code (cleaned up so you can read it)  in the 2d script of your new drawing title:

 

line2 -0.005, 0, 0.065, 0
circle2 0, 0, 0.005


define style{2} "Arial_STYLE_2mm" "Arial", 2, 0!!!2mm Arial text....you can change this,



set style "Arial_STYLE_2mm"

paragraph "Drawing name Paragraph" 2, 0, 0, 0, 1
AC_DrawingName !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"Drawing name aligned to the left"
endparagraph
textblock "Drawing name TEXTBLOCK" 0, 7, 0, 1, 1, 1,
"Drawing name Paragraph"
richtext2 0.005, 0, "Drawing name TEXTBLOCK"



paragraph "Drawing scale Paragraph" 2, 0, 0, 0, 1
AC_OriginalDrawingScale !!!!!!!!!!!!!!!!"Drawing Scale aligned to the left"
endparagraph
textblock "Drawing scale TEXTBLOCK" 0, 1, 0, 1, 1, 1,
"Drawing scale Paragraph"
richtext2 0.005, 0, "Drawing scale TEXTBLOCK"



paragraph "Drawing ID Paragraph" 2, 0, 0, 0, 1
AC_DrawingNumber !!!!!!!!!!!!!!!!!!"Drawing ID"
endparagraph
textblock "Drawing ID TEXTBLOCK" 0, 8, 0, 1, 1, 1,
"Drawing ID Paragraph"
richtext2 0, 0, "Drawing ID TEXTBLOCK"

paragraph "Back Ref Paragraph" 2, 0, 0, 0, 1
"<BACKREFSHEETNUMBER_R><DUMMY><.>" + AC_BackReferenceGUIDList[1] !!!!!!!!!!!!!!!!!!!!!!!!!!"Back Ref"
endparagraph
textblock "Back Ref TEXTBLOCK" 0, 2, 0, 1, 1, 1,
"Back Ref Paragraph"
richtext2 0, 0, "Back Ref TEXTBLOCK"

and you have your title you wanted.

 

 

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 27
Member of Architalk since 2003, but missed the migration to Graphisoft.
(where have all my original posts gone?)
Ahmed_K
Advisor

Thank you so much for your time and effort !! 

last week i spent a day to understand how the linear drawing title object works , 

after a looot of headacke i modified the defaut object and it looks exactly like i want, the edited script is close to yours,

i'd like to test your method and see what i get ! 

thanks 😄

here i share with you the object i got agter editing , 

AMD Ryzen 9 3900X, 32 GB RAM, RTX 3080 10 GB
Archicad 27
Windows 11 professional
https://www.behance.net/Nuance-Architects
JeffH
Advocate

very loosely following along with this topic,

 

is it possible to call the North Arrow Object so that within the circle of the drawing Title for Plans, the North Arrow is automatically inserted, and follows along with the project north as assigned under the project preferences.

 

Just seeing if anyone has attempted such a ridiculous idea, prior to my many awful attempts.

AC24 / AC26 / AC27
Win10
Lingwisyer
Guru

I do not believe there is a way for a Drawing Title to retrieve information on how a View is rotated... You might be able to just use GLOB_NORTH_DIR if none of your views are rotated, though I am unsure how that works on Layouts...

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

That ended up working out great!  figuring out the rest of what I am trying to do may bring about the need for another post or 2 in here.

 

Thanks @Lingwisyer !

AC24 / AC26 / AC27
Win10