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

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

Customizing custom drawing title

Anonymous
Not applicable
Is there a way to add a parameter to allow for a custom drawing title to "stretch"? I need the drawing title to be able to adjust in length (width) depending on the drawing name.
7 REPLIES 7
David Maudlin
Rockstar
doober922:

You can use the STW command to find the length of a text string (define the Text Style first). From the GDL Reference Guide:
STW
STW (string_expression)
Returns the (real) width of the string in millimeters displayed in the current style. The width in meters, at current scale, is STW
(string_expression) / 1000 * GLOB_SCALE.

You can then use this value in your code to get the title width.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
Would that work this? We need the north arrow to move to the right as needed when the drawing name is long.
Screen Shot 2014-08-22 at 10.50.44 AM.png
David Maudlin
Rockstar
doober922 wrote:
Would that work this? We need the north arrow to move to the right as needed when the drawing name is long.
Yes. Use the STW command to calculate the length of the Title text, and if that length is greater than the space to the north arrow, then increase the underline length and move the north arrow and scale to the right the length of the Title text (plus a bit more).

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
Thank you for your help. I'm stumped however. I understand enough code/script to be dangerous. I'm not sure where I insert the new piece of code and what to put with the STW command.
David Maudlin
Rockstar
doober922:

I am not familiar with the Title you are modifying (I don't see it as a standard ArchiCAD Title), but generally the code would be:

DEFINE STYLE name font_family, size, anchor, face_code
SET STYLE name_string
Name_Length = STW (AC_DrawingName)/1000

The Blue texts are GDL commands (see the GDL Reference Guide for more information), the Red text is the parameter name for a drawing title and the Green text is the length of the title (this can be any allowed name).

You will have to look through the code to see where and how to use the distance in Name_Length, it depends on how this library part was written.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
This was a title I made by creating it in a plan view and creating a title from that. I made it around 7 or so years ago. I will see if I can change the script as you have stated.
David Maudlin
Rockstar
doober922:

Since the Title was created by saving (rather than scripting), you will need to look throughout the code to see where the various parts of the Title are in the code, then start making some parts parametric (they are probably all hard-coded now: they have numbers rather than parameters for their dimensions). You can comment out (place a "!" at the start of a line of code) each command to help figure out which part of the code corresponds to a part of the Title.

Your other option is to go through the same process to create another hard-coded Title, but wider, then choosing between the two depending on Drawing Name length, but that is not an elegant solution.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14