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

Story Display

Anonymous
Not applicable
I am trying to script a 2d library part in AC11 that would let me control the stories it displays on,, ie. 1,2,3, (nor 4 and 5) then 6, 7,8.

Any Ideas?

Alternatively, I would settle for just a sequential range ie, 1 through 6

Tomas
7 REPLIES 7
Anonymous
Not applicable
The stories that placed parts can show on are defined in the "Show on Stories:" setting in the Info Box or settings dialog, but the options are limited. Normally the symbol will display on all the allowed/selected stories unless it is coded to do otherwise in the 2D script.

Unfortunately there is no custom setting for library parts as there are for slabs and roofs. You may be able to do something by choosing "All Relevant Stories" and controlling which stories are "relevant" in the scripts, but I have not tried this and don't know how ArchiCAD determines which stories are relevant nor whether they can be discontinuous. The first thing to test is to see if "relevance" is determined by the 2D script, the 3D script or both. It's an interesting problem. I wish I had time to work it out myself.

Good luck. Please post back if you figure it out.
Anonymous
Not applicable
From the GDL reference guide p133 AC11 & p162 AC12 -
All Relevant Stories: The element will be shown and editable on
all stories which it physically intersects. When available, this will
be your preferred option most of the time.
Sounds like it is 3d based.
Anonymous
Not applicable
Peter wrote:
From the GDL reference guide p133 AC11 & p162 AC12
Rubbish! I meant the AC Reference Guide!

Sorry
Are you talking about something 3D interacting with stories and the cut plane? It doesn't sound like you are, it sounds like you want to turn a symbol off and on.

The key is the global variable GLOB_CH_STORY_DIST (S~), which describes the relationship between the currently displayed story and the object's home story. I don't know if this will do everything you want. You will have to tell it explicitly what stories to show on; parameters for ranges and skipping stories will be clunky but should work in theory.

The object would be shown on All Stories, then you would have IF/THEN conditionals to draw the geometry, or not, based on the current story.

When viewing the object's home story, S~ = 0. One story up, S~ = 1. Two stories up, S~=2. One story down, S~ = -1. Etc.

Simplest case, you have a checkbox for a parameter, showOnStoryAbove.
IF S~=0 THEN !! always show on home story
!! draw stuff
ENDIF
IF S~=1 AND showOnStoryAbove=1 THEN
!! draw stuff
ENDIF
(You'd never do that, you'd just use the story display setting.)

More complicated, an integer parameter for showOnHowManyStoriesUp:
IF S~=0 THEN !! always show on home story
!! draw stuff
ENDIF
IF S~>0 AND S~<= showOnHowManyStoriesUp THEN
!! draw stuff
ENDIF
A gap followed by another range would be more complex again.

To be clear, S~ relates to the home story of the object, not to story 1 or anything like that. So the user would be indicating stories relative to the object, not to the actual story structure of the project. (You could convert S~ to the absolute story by using the "Story" REQUEST.)

I think you will get a weird behavior on stories where the code stops anything from being drawn. (E.g., the current story is 6 stories up and the object should only show through 5.) I think you get a dot like the object was missing or erroneous. In the past I have seen that cause errors on 'showing' stories. For safety, always have the object draw something, even if it's just a tiny line with a non-printing pen.
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info
'Relevance' for objects in AC12:

'All Relevant stories' is a new option for objects in 12; it isn't present in 11. But it doesn't appear to do anything. I can't see new globals or REQUESTs relating to it. The Standard Elevator 12 doesn't seem to take advantage of it, I thought maybe it should, for example.

You can determine 'relevance' w/r/t stories and cutplanes using the various story globals, but there's nothing automatic available that I can see.

??
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info
vistasp
Advisor
james wrote:
The key is the global variable GLOB_CH_STORY_DIST (S~), which describes the relationship between the currently displayed story and the object's home story.

....
If only the GDL reference guide explained things with as much clarity - if at all. It contains practically nothing on the usage of this function!

Thank you James.
= v i s t a s p =
bT Square Peg
https://archicadstuff.blogspot.com
https://www.btsquarepeg.com
| AC 9-27 INT | Win11 | Ryzen 5700 | 32 GB | RTX 3050 |
Laszlo Nagy
Community Admin
Community Admin
Try this for a bit better explanation:

http://www.archicadwiki.com/Global%20GDL%20Parameters#StoryInformation
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

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!