GDL
About building parametric objects with GDL.
SOLVED!

drawing title object not working in AC25

jkershaw
Enthusiast

We have been using a custom drawing title object since AC20 with no issues. Now that we are using AC25, the title is behaving correctly ON SCREEN, but when we print or save as PDF, the title object displays the information for ALL drawings on the layout. 

 

Need help solving this. GDL script below. Thanks!

 

correct display on screencorrect display on screenissue when printing or saving to pdfissue when printing or saving to pdf

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

!! convert pt size to mm size !!
 
titleSizeMM = titleFontSize * 0.352778
numberSizeMM = numberSize * 0.352778
scaleSizeMM = scaleSize * 0.352778
 
 
DEFINE STYLE title_type titleFont,  titleSizeMM, 7, 0
DEFINE STYLE number_type numberFont, numberSizeMM, 8,0
DEFINE STYLE scale_type scaleFont, scaleSizeMM, 1,0
 
 
IF showTitle = 1 THEN
STYLE title_type
PEN 1
PARAGRAPH "paragraph_title"  1, 0, 0, 0, 1
"<DRAWINGNAME>"
ENDPARAGRAPH
TEXTBLOCK "textBlock_title"  0, 7, 0, 1, 1, 1, "paragraph_title"
 
ADD2 37/64",0
RICHTEXT2 0, 0, "textBlock_title"
 
ENDIF
DEL TOP
 
 
IF showNumber = 1 THEN
STYLE number_type
PEN 1
PARAGRAPH "paragraph_number"  1, 0, 0, 0, 1
"<DRAWINGID>"
ENDPARAGRAPH
TEXTBLOCK "textBlock_number"  0, 8, 0, 1, 1, 1, "paragraph_number"
ADD2 1/4",0
RICHTEXT2 0, 0, "textBlock_number"
 
ENDIF
DEL TOP
 
PEN 2
LINE2 0,0,1/2",0
HOTSPOT2 1/2",0
HOTSPOT2 0,0
DEL TOP
 
IF showScale = 1 AND not_to_scale = 0 THEN
STYLE scale_type
PEN 1
PARAGRAPH "paragraph_scale"  1, 0, 0, 0, 1
"<DRAWINGSCALE>"
ENDPARAGRAPH
TEXTBLOCK "textBlock_scale"  0, 1, 0, 1, 1, 1, "paragraph_scale"
 
ADD2 9/16",-3/64"
RICHTEXT2 0, 0, "textBlock_scale"
 
ENDIF
DEL TOP
 
IF showScale = 1 AND not_to_scale = 1 THEN
STYLE scale_type
PEN 1
PARAGRAPH "paragraph_scale"  1, 0, 0, 0, 1
"NOT TO SCALE"
ENDPARAGRAPH
TEXTBLOCK "textBlock_not_to_scale"  0, 1, 0, 1, 1, 1, "paragraph_scale"
 
ADD2 9/16",-3/64"
RICHTEXT2 0, 0, "textBlock_not_to_scale"
 
ENDIF
DEL TOP

 

 

 

AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
jkershaw
Enthusiast

Thanks, Eduardo.

 

I was able to solve the issue by replacing what I call the "shortcut" variables - <DRAWINGNAME>, <DRAWINGID>, etc - with the global AC variables (AC_DrawingName, AC_DrawingNumber, etc.)

AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5

View solution in original post

8 REPLIES 8
Eduardo Rolon
Moderator

Might be the Title bug in AC25.

See here

https://community.graphisoft.com/t5/Document-Visualize-forum/Custom-drawing-title-issue-with-ArchiCA...

Eduardo Rolón AIA NCARB
AC27 US/INT -> AC08

Macbook Pro M1 Max 64GB ram, OS X 10.XX latest
another Moderator

Solution
jkershaw
Enthusiast

Thanks, Eduardo.

 

I was able to solve the issue by replacing what I call the "shortcut" variables - <DRAWINGNAME>, <DRAWINGID>, etc - with the global AC variables (AC_DrawingName, AC_DrawingNumber, etc.)

AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5
Lingwisyer
Guru

For future reference, those shortcut variables are called Autotext.

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

Sorry...
but it seems that I'm to stupid to replace 'Autotext' with 'Variables'

If i put between quotes there appers the name of the variable in the titel instead the name of the drawing...

if i put it plain in, I get an error.

 

And how to replace <DRAWINGID> ?

 

 

text2 (AC_DrawingRect[3]-DistH),DistV,"<DRAWINGNAME>" + " <DRAWINGID>"

 

 

 

ARCHICAD for Future
______________________________________

archicad versions 8-27 | mac os 13 | win 10

I'm too stupid to know all the right terminology, but I'll do my best to answer.

 

Archicad has global variables for use in the GDL code. I utilized the following:

AC_DrawingName

AC_DrawingNumber

AC_DrawingScale

 

These variables should not be in quotations when scripting in GDL.

 

Here's an example of the code:

PARAGRAPH "paragraph_number"  1, 0, 0, 0, 1
	AC_DrawingNumber
ENDPARAGRAPH

 

AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5

Thank you for your reply!

 

But it seems to use

'PARAGRAPH' instead of 'Text2' there is a complete different "environment" necessary...

... or someting with (a?) 'string' is necessary...(Warning in the editor...)

 

So you see, I don't have much knowledge of GDL-Script...

...seems that basics, like showing the "result" of a variable in the "output" are missing with me.

 

I looked several times into manuals but whether I didn't look for the right things or I just don't understand what's written there.

ARCHICAD for Future
______________________________________

archicad versions 8-27 | mac os 13 | win 10

apologies - I should have given you the full code in context. I'm no GDL expert - more of a hack.

 

This is part of a larger script. This is the section that generates the drawing title.

IF showTitle = 1 THEN
STYLE title_type
PEN 1
PARAGRAPH "paragraph_title"  1, 0, 0, 0, 1
	AC_DrawingName
ENDPARAGRAPH
TEXTBLOCK "textBlock_title"  0, 7, 0, 1, 1, 1, "paragraph_title"
ADD2 37/64",0
RICHTEXT2 0, 0, "textBlock_title"

 PARAGRAPH is a means of defining styles and alignments. It also defines the output. In this case, the output is the variable AC_DrawingName.

 

TEXTBLOCK defines more options for anchor points, width_factor, etc. In this case, the output of the text block is the information defined in PARAGRAPH.

 

RICHTEXT2 is what actually outputs the text. It outputs the information defined in TEXTBLOCK.

 

You can use TEXT2, but you'll have less control over formatting:

TEXT2 0,0,AC_DrawingName
AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5

With help trough the german Archicad-Discord Channel I could finally solve the 'problem' (just at the day the next Archicad update is announced... 😉 )
The key issue was, that the name of the variable has to be typed manually into the parameter list.

 

… and to get a space in the output between several expressions I had to learn what's about the 'str' command.

ARCHICAD for Future
______________________________________

archicad versions 8-27 | mac os 13 | win 10