GDL
About building parametric objects with GDL.

MEP label

Njegos T
Contributor
Hello everyone,

I've question for you guys about script for MEP label.
Does it possible to create label that can show lenght of element (Pipe, Duct or Cable tray)? Like for Property Value in popup meny of "Property Label" can be shown also Parameters of some element?

I hope so that you understand my question.
8 REPLIES 8
Laszlo Nagy
Community Admin
Community Admin
When you place an Autotext into a Label, you have hundreds of Properties and Parameters to choose from.
In case of GDL Objects, like MEP elements, here are some you can try:

Object/Lamp > Length (A)
General Parameters > Width
General Parameters > Height

These three return the length, width and height, respectively, of Objects.
So for your case, you should try the first one with that MEP element, see if it returns the correct length value.
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
Njegos T
Contributor
Jo napot kivanok Laszlo and thanks for answering me.

I've try but it doesn't show me real lenght, it's only take values from A B and ZZYZX (every time is 100 100 25)
For MEP length is written like MEP_StraightLenght instead ZZYZX, so I would like to know how to re-define the script to take values from that parameter and is it possible?
Laszlo Nagy
Community Admin
Community Admin
I don't think this is possible. It does not matter if you modify the script of the MEP Element, because Properties have a limitation: they cannot get values from parameters of Library parts. And the Property Label can only list the values of Properties.
Similarly, Labels cannot display the values of parameters of Library parts. Only in Schedules can you do that, but not in Labels.

You should try other available Properties to see if one of them possibly lists the value you are looking for.
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
Barry Kelly
Moderator
Labels can be scripted to read particular parameters from objects, but what works for one object may not work for others if the parameters are different.

You have to script a label to look for a particular parameter.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Laszlo Nagy
Community Admin
Community Admin
Barry wrote:
Labels can be scripted to read particular parameters from objects, but what works for one object may not work for others if the parameters are different.

You have to script a label to look for a particular parameter.

Barry.


You are right, Barry, sorry, I forgot about the possibility of creating your own Label and scripting it to read the parameter values of its associated library part. If I am not mistaken, you would have to use the

n = REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)

command to do it.
Thanks for the correction.
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
vdentello
Advocate
I had to do this once, my solution was to edit MEP part to make value A equal to length if im not mistaken.
Archicad User Since 2013
GDL Developer
Experimenting with API
from Brazil
toofuerte
Contributor
How do I use the script in a label to pull the values from the MEP parts in AC24. Sorry I don't understand the scripting language. Is there a article in Help that would help with this? I have looked and i still don't understand.
I can get to the parameters in the schedule but not in the labels as stated above. The MEP parts have different parameters for the Height, Width and length so we can't use the A, B, ZZYZX.

I am also trying to use the parameters to pull the element info and then place it in the label, but don't know how to use the function there either.
Gerald Acton "Gary"

Acton Design Services

Windows 10 PRO 64 bit

i7-5820K @ 3.30ghz 32GB Ram

Nvidia GeForce GTX 1650 4GB Ram

AC 19 - AC 26
toofuerte
Contributor
I have gotten a simple MEP Label I am including a link to it.



Here https://drive.google.com/file/d/1LnwEdmjreL-6LHy6I1OOkGhk39dokEOa/view?usp=sharing
Gerald Acton "Gary"

Acton Design Services

Windows 10 PRO 64 bit

i7-5820K @ 3.30ghz 32GB Ram

Nvidia GeForce GTX 1650 4GB Ram

AC 19 - AC 26