Wall Label - IFC Properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2014-11-17 11:51 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2014-11-17 04:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2014-11-19 01:20 PM
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)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2014-11-19 08:39 PM
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.
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2014-11-21 09:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-21 01:57 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-21 10:06 PM
DGSketcher wrote:Hi.
Thanks for the pointers lazlo but page 368 isn't very helpful if you aren't familiar with the syntax or data structure.
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:Challenge accepted!!!
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?
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" parValueFloor 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-21 11:45 PM
I will post here when I have made some positive steps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-22 01:22 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-01-22 04:16 PM
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 1to 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.