GDL
About building parametric objects with GDL.
SOLVED!

Variables to Access Zone Information

pedrocollares
Enthusiast

Since AC25 we're able to label zones, and I'm attempting to design a label which gets information from a zone. Basically, I'd like to put out Zone Number, and its story index, to put up a "Room name" automatically, which would be:

 

<Room type name (Room, Apartment, etc)> + <Story index> + <Room/Apt. Number>

 

Using the following parameters:

 

<ELEMENT ID> + <STORY INDEX> + <ZONE NUMBER>

 

Example: Room 1205, or Apartment 804

 

  • Element ID: Easy to get using GLOB_ID
  • Story Index: Been trying "n = REQUEST ("Home_story", "", index, story_name)" with no luck, it always puts out the index of the 1st floor which is 0. (Same would go for the "story_name")
  • Zone Number: Clueless on how to obtain such info in GDL

 

I could achieve that using Properties, but they're a bit unstable if anyone in our firm messes up the classifications. I like putting up things natively with GDL, in case it is possible I would prefer.

 

If anyone has directions on any of these, I'd be very thankful! 🙂

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

As an architect student, I can understand the struggle. 🙂 

Let's see the GDL solution then.

 

Firstly, requesting the home story number would look something like this: 

n = REQUEST ("Home_Story", "", index)
TEXT2 0, 0, index

(The story_name in your case is not necessary, if you would only want to use the story number.)

Of course you have to add/subtract the "story number gap" as well, to calculate the correct story number for your plan.

The reason for your index value returning 0 all the time could be, that this request returns the home story of the label itself, although I have no idea how you could put a label for a zone on a different story, but maybe try looking into that.

 

The solution for zone number with built-in properties: 

_zoneNumber = 0
m = REQUEST ( "Property_Value_Of_Parent", "Builtin.Zone_ZoneNumber", _typeValue, dim1, dim2, _zoneNumber)
text2 0,0, _zoneNumber

The _typeValue, the dim1 and dim2 parts are output values as well, you can reference or print them later in your code if needed. 

In place of zone number you can use other built-in properties with this request, that I've mentioned earlier. 

View solution in original post

6 REPLIES 6
Zsuzsanna Bori
Graphisoft
Graphisoft

Hi! 

The easiest way to solve your problem would be to use autotexts (you can find home story name and number as well) and save them as a label. 

If you want a more complex/GDL solution, you should dive into built-in properties and parent requests. You can find more on this topic in the GDL reference guide on the GDL center under "BUILT-IN PROPERTY GUIDE". http://gdl.graphisoft.com/reference-guide/built-in-property-guide 

pedrocollares
Enthusiast

Hi Zsuzsanna!

 

Simply using some auto-text would be the best solution indeed. The problem is, eventually the AC Story Number won't match the building's actual story number. We generally use Story number zero to place the terrain and that sometimes generates a "story number gap". That's why I end up using properties so I can add/subtract the gap value. But Properties can be unstable if someone messes up classifications and such, so I was trying to add/subtract the gap value inside the GDL code itself.

 

Those built-in properties seem to be very useful! How can I request them? Got a bit confused on where do I enter those names in the REQUEST function.

 

They will allow me to get the Zone Number value, though I didn't find a Story Number property there.

 

I wasn't able to put out the Story Number using the regular REQUEST command:

 

pedrocollares_0-1647203322069.png

 

That index keeps returning 0 in whichever Story the zone is. (Also, the story name keeps returning the Story 0's name, which gives me a clue that Request is getting always a fixed story's info)

 

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64
Solution

As an architect student, I can understand the struggle. 🙂 

Let's see the GDL solution then.

 

Firstly, requesting the home story number would look something like this: 

n = REQUEST ("Home_Story", "", index)
TEXT2 0, 0, index

(The story_name in your case is not necessary, if you would only want to use the story number.)

Of course you have to add/subtract the "story number gap" as well, to calculate the correct story number for your plan.

The reason for your index value returning 0 all the time could be, that this request returns the home story of the label itself, although I have no idea how you could put a label for a zone on a different story, but maybe try looking into that.

 

The solution for zone number with built-in properties: 

_zoneNumber = 0
m = REQUEST ( "Property_Value_Of_Parent", "Builtin.Zone_ZoneNumber", _typeValue, dim1, dim2, _zoneNumber)
text2 0,0, _zoneNumber

The _typeValue, the dim1 and dim2 parts are output values as well, you can reference or print them later in your code if needed. 

In place of zone number you can use other built-in properties with this request, that I've mentioned earlier. 

Thanks a bunch! Zone number worked, but I guess I'll have some trouble to get the story number info.

 

Indeed, the story it puts out is the label's story. Tested it in floor plan and it works like so. In section though, the home story of the labels become invalid, always returning zero. The main reason for having such label is to use it in sections, so that generates me an issue.

 

As it seems, Home story index isn't available as a built-in property. The only way I see to achieve it would be making comparisons of the object's elevation to the project story configuration.

 

pedrocollares_0-1647622795969.png

I'd have to run through a loop, discounting the elev. from home story and looking for a elevation match with some project story. But it should work, I guess?

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64

I'm happy to help! 

Ohh, that makes sense! That really isn't an easy problem to solve. I hope you can find a way to work it out, if not, I will try to find a solution as well, keep me posted about your progress. 🙂 

 

Hi,

 

maybe a simpler way would be (without GDL) to create a property expression that calculates home story + N, and use that property in an autotext label.

PeterBaksa_0-1647879625576.png

 

Péter Baksa
Software Engineer, Library
Graphisoft SE, Budapest