cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Wall Label - IFC Properties

Anonymous
Not applicable
Hello all.

I am creating a custom wall label in ArchiCAD 18. Can I extract information from walls IFC properties (ex. fire rating) and show them in my label?
13 REPLIES 13
Link
Graphisoft Partner
Graphisoft Partner
Like this?

Cheers,
Link.
Anonymous
Not applicable
Thank you....

That's fantastic!

But I want to create a totally new custom label. Suppose I create an IFC parameter that is called xxx. How can I request this parameter in my new GDL label. Is there a way to do this (ex. request IFC_xxx)?
Laszlo Nagy
Community Admin
Community Admin
You have to check how the Generic Label 18 object does it and you will see.

I checked it and in its Master Script it calls a macro called label_content_macro.

Then in its Master Script, this label_content_macro macro object calls another macro object called TnCParamRequest. That is the macro you need to look at more closely. (I guess TnC stands for the Tags and Categories panel.

It is quite complicated but it uses special GDL commands that are described in the GDL Reference Guide PDF on Page 368. With this it can get folder names, parameter names and parameter values from the Tags and Categories panel.
Unfortunately I have not dug myself deeper into this so I cannot be of more help, but this is the direction you should start in.
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
Anonymous
Not applicable
Thank you! I will give it a try!
DGSketcher
Legend
Thanks for the pointers lazlo but page 368 isn't very helpful if you aren't familiar with the syntax or data structure.

Anyone able to shed any more light on this with a simple worked example of grabbing a single predetermined IFC parameter's value for use in a label?
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
sinceV6
Advocate
DGSketcher wrote:
Thanks for the pointers lazlo but page 368 isn't very helpful if you aren't familiar with the syntax or data structure.
Hi.
If you are planning to create a label, I would suggest to get into understanding syntax and data structure. It is essential as many things label-related are requested from the object being labeled and sometimes the data comes in as arrays. I do grant that explanation of syntax in the manual is not really that user friendly.
DGSketcher wrote:
Anyone able to shed any more light on this with a simple worked example of grabbing a single predetermined IFC parameter's value for use in a label?
Challenge accepted!!!

Here's a little something:

Create a new object and create 3 string (or text) parameters named:
folders
params
value

give each one a description.

In the master script, paste this:
HOTSPOT2 0,0
CIRCLE2 0,0,0.10


idstring=1
shortName=2
longName=3

!===FOLDER NAMES=====
DIM folderNamesArray[] !<-- array will hold 3 entries per folder: idstring, shortName, longName
						!-- main folder only has idstring, short and long name are empty

n = APPLICATION_QUERY ("OwnCustomParameters", "GetParameterFolderNames()", folderNamesArray) !<-- n = quantity of folders * 3 (includes main/root folder)

DIM folderShortName[]
FOR i=1 TO VARDIM1(folderNamesArray)/3
	folderShortName=folderNamesArray[3 * (i-1) + idString]
NEXT i
VALUES "folders" folderShortName   !OR folderNamesArray !<-- which displays all values of array in parameter "folders"

foldersInTagsAndCats = n/3 !--or VARDIM1(folderNamesArray)/3

!!!PRINT folderNamesArray
!!!PRINT foldersInTagsAndCats

FOR i=1 TO n
	TEXT2 0,0, folderNamesArray
	ADD2 0,-0.75
NEXT i
DEL n


!===PARAMETER NAMES=====
DIM parNamesArray[] !<-- array will hold 3 entries per parameter name: idstring, shortName, longName

n = APPLICATION_QUERY ("OwnCustomParameters", "GetParameterNames(" + folders + ")", parNamesArray) !<-- middle part "GetParameterNames...+...+..." between commas should work out as a whole string

DIM paramNames[]
FOR i=1 TO VARDIM1(parNamesArray)/3
	paramNames=parNamesArray[3 * (i-1) + idString]
NEXT i
VALUES "params" paramNames	!OR parNamesArray !<-- which displays all values of array in parameter "params"


!===PARAMETER VALUE=====
parValue=""

n = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(" + params + ")", parValue) !<-- middle part "GetParameter...+...+.." between commas should work out as a whole string

VALUES "value" parValue
Floor plan will show all folders from the objects Tags and Categories tab.
Object parameters, in settings, will let you see folders, parameters based on folder selection and the value from the selected parameter.

Code is commented so you can understand and start from there. Note that for a label you would need to change "OwnCustomParameters" to "ParentCustomParameters" as labels would use the object's parameters, not the label ones.

Basically, you request folder names (and get that in an array); you use one to give it to the request for the parameter names (to get the parameter names of that folder), and use that to get the value with a third request.

If you want to have every available parameter in a list, you will need to alter the code to create a data structure that allows for this to happen. This is also true if you want to see the folder short names or long names (not their idString) in the parameters.

I'm not sure if the requests would work with something different than the idstring for folders and parameter names. Guess it wouldn't as the main folder leaves two empty strings as you will find out.

Hope that helps you understand... and if you can, share the outcome. Other people here will find it useful.

On a side note, the manual states that for the folder names request, the returned value n is "n+1:the number of folders including the root folder". It is kind of confusing. I understand that initially there are 3 folders: two default ones (renovation and IFC properties) plus the main root one so "n" would be representing those 2 folders plus the root one, thus "n+1"; but "n" returns 9, as for each folder there are 3 entries. I think the manual should state n/3=number of folders, not n+1. Hope I'm making sense.

Best regards.
DGSketcher
Legend
sinceV6, many thanks for your contribution. I will have a look at this and see if it is taking me where I think I want to go. Certainly seems to demystify some of the manual.

I will post here when I have made some positive steps.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
DGSketcher
Legend
Had a bit of a play and SinceV6's routine has given a lot of useful insight to the data.

Things were progressing well until I hit a problem which is related to sourcing the data. In the label I have created there are two lines, the first shows the objects layer, the other extracts and displays the required IFC data. The problem is if I change layer the label updates immediately as expected but if I change the value of the IFC data in the object it doesn't and I have to open the label to force the refresh.

Can anyone cast some light on forcing a label refresh automatically? If I change several objects at the same time I don't want to find out the drawings hit site and still have old values in the labels.

I am using Text2 for the output and have seen reference in the GDL manual to this having refresh issues but nothing that made sense to my basic programming skills. It doesn't seem to be a problem in the Generic 18 label.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
sinceV6
Advocate
Hi.

That's weird.

I took the object, turned it into a label, changed "OwnCustomParameters" to "ParentCustomParameters" and did nothing else but comment out the first TEXT2 part and added at the end:

ADD2 0.50,0
TEXT2 0,0,value
DEL 1
to show the selected value.

It updates as expected. Even works when adding custom IFC properties, such as the outside surface like in the great example Laszlo posted for using the generic label.

Perhaps there is something else happening?

Best regards.
Learn and get certified!