cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Durval
Expert

Show Story level in the Drawing title of a Plan view

I am looking for a means to code a Drawing Title that can automatically read the story level set in Model>Story Settings if the title is attached to a Plan View.
I could find a REQUEST ("STORY_INFO", ...), but I don't know how to tell the title's script if it is linked to a plan view and, if so, in what story.
Is this possible?

 

 

--- www.dtabach.com.br ---

AC 28/29 BRA – MacBook Pro Apple M2 16GB RAM Mac OS Sequoia
1 Solution

Accepted Solutions

It is indeed possible, see working Drawing Title attached:Screenshot 2025-05-25 at 00.20.14.png:
In the Master script:

n = request ("REFERENCE_LEVEL_DATA", "", name1, elev1, name2, elev2, name3, elev3, name4, sealevel)

DIM t[]
n = request ("STORY_INFO", "", nr, t)

dim story_nr[], name[], elevation[], height[]

! Iterate through the stories
for i = nr to 1 step -1
story_nr[i] = str ("%.0m", t [4 * (i - 1) + 3])
name[i] = t [4 * (i - 1) + 2]
elevation[i] = str ("%m", t [4 * (i - 1) + 1] - sealevel) ! Here remove " - sealevel" if you just want the elevations to Project 0.
height[i] = str ("%m", t [4 * (i - 1) + 4])
next i



And in the 2D script:

drawingName = AC_DrawingName  ! Default value
for i = 1 to vardim1(name)
if STRSTR(name[i], AC_DrawingName) > 0 then drawingName = AC_DrawingName + " " + elevation[i]
next i

 

Archicad 29 ARM, MacBook Pro M3 Max 128Gb, macOS Tahoe.
/ co-founder /Operations Director /BIM Lead @ www.airc.digital ltd ™
M Architecture & Urbanism

Go to post

4 Replies 4
vlahtinen
Advocate

AFAIK, it’s not possible. The only way is to include the story name in the view name or id.

It is indeed possible, see working Drawing Title attached:Screenshot 2025-05-25 at 00.20.14.png:
In the Master script:

n = request ("REFERENCE_LEVEL_DATA", "", name1, elev1, name2, elev2, name3, elev3, name4, sealevel)

DIM t[]
n = request ("STORY_INFO", "", nr, t)

dim story_nr[], name[], elevation[], height[]

! Iterate through the stories
for i = nr to 1 step -1
story_nr[i] = str ("%.0m", t [4 * (i - 1) + 3])
name[i] = t [4 * (i - 1) + 2]
elevation[i] = str ("%m", t [4 * (i - 1) + 1] - sealevel) ! Here remove " - sealevel" if you just want the elevations to Project 0.
height[i] = str ("%m", t [4 * (i - 1) + 4])
next i



And in the 2D script:

drawingName = AC_DrawingName  ! Default value
for i = 1 to vardim1(name)
if STRSTR(name[i], AC_DrawingName) > 0 then drawingName = AC_DrawingName + " " + elevation[i]
next i

 

Archicad 29 ARM, MacBook Pro M3 Max 128Gb, macOS Tahoe.
/ co-founder /Operations Director /BIM Lead @ www.airc.digital ltd ™
M Architecture & Urbanism
vlahtinen
Advocate

You’re right! I read the original question too hastily. I thought the question was about the story name not elevation. 

 


However, in your solution, it’s required that the name of the drawing is included in the name of the story. In other words, the drawing is linked to the correct story using the name. That might usually be the case, but maybe not always.

Durval
Expert

Great, Jaime-airc_digital's solution worked!
With the following observations:

- As you inverted the order of the loop ('nr to 1 step -1' instead of '1 to nr') it is necessary to invert also the order of the variable definitions, otherwise the elevation value will be stored in story_nr and vice-versa. Or you can uninvert the loop (use 'for i = 1 to nr').
- As I don't need the sea leval info, I don't need the 'REQUEST ("REFERENCE_LEVEL_DATA,...)'.
- As vlahtinen pointed out, the Drawing name should be contained in the Story name. I found it more reasonable the other way round: that the Drawing Name should contain the Story name, so that I can give names to drawings such as "Ground Floor - Equipments". So I inverted STRSTR command and added 1 so that it becomes case insensitive: 'if STRSTR (AC_DrawingName, name [i], 1) > 0 ...'
Thank you for your valuable help, it saved me hours of work!

--- www.dtabach.com.br ---

AC 28/29 BRA – MacBook Pro Apple M2 16GB RAM Mac OS Sequoia

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!