License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…
2025-05-23 05:31 PM
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?
Solved! Go to Solution.
2025-05-25
01:23 AM
- last edited on
2025-05-25
09:21 PM
by
Laszlo Nagy
It is indeed possible, see working Drawing Title attached::
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
2025-05-24 08:48 AM
AFAIK, it’s not possible. The only way is to include the story name in the view name or id.
2025-05-25
01:23 AM
- last edited on
2025-05-25
09:21 PM
by
Laszlo Nagy
It is indeed possible, see working Drawing Title attached::
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
2025-05-25 10:15 AM - edited 2025-05-25 11:14 AM
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.
2025-05-26 05:46 PM
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!