2023-01-13
10:52 AM
- last edited on
2024-04-16
06:17 PM
by
Laszlo Nagy
Hi Guys,
Is it possible to extract Properties from Building Materials?
I want to use this in a Label and process the data further as part of my Temperature Label:
https://www.linkedin.com/posts/debruinbimproductspecialist_archicad-activity-7016077546198818816-0Kz...
With kind regards,
Jeroen de Bruin
2023-01-16 09:52 AM
2023-01-16 10:24 AM
Hi,
BUILDING_MATERIAL_INFO is only for (old) physical properties.
Other properties can be read with COMPONENT_PROPERTY_VALUES_OF_PARENT.
The code needs to know the IDs of the requested properties, currently the only way is that the user must select them on the UI. You can show a list on the UI using COMPONENT_PROPERTY_TREE_OF_PARENT. You also need to get the list of building materials in the labelled object with COMPONENT_IDS_OF_PARENT.
For an example see Archicad Library's Component Classification and Properties Label.
2023-01-23 11:39 AM
Hi Peter,
Thanks. I looked into this Component Classification and Properties Label, but that is next level GDL-stuff. Could you help me out a bit?
For Instance, I would like to get the number out of the Building Material Property 'Vapour Pressure'. How would you build that?
thanks in advance!
Jeroen
2023-01-30 10:49 AM - edited 2023-01-30 10:49 AM
Hi,
With a parameter called "prop":
UI:
DICT propFilter, propTree
propFilter.propertyType = "ACPROPERTY"
n = REQUEST ("Component_Property_Tree_Of_Parent", propFilter, propTree)
if n > 0 then
_propertyName = ""
n = REQUEST ("Property_Name", prop, _, _, _propertyName)
ui_custom_popup_infield "prop", 0, 0, 300, 19,
1, propTree.treeDepth, 1, _propertyName,
propTree.propertyTree
endif
ui_outfield prop, 0, 20, 300, 20
2D:
dict collectComponents
collectComponents.collectMode = 1
dict outputCompIds
n = REQUEST ("Component_IDs_Of_Parent", collectComponents, outputCompIds)
if n > 0 then
for i = 1 to vardim1(outputCompIds.componentIds)
dict compPropInput, compPropVals
compPropInput.componentId.id = outputCompIds.componentIds[i].id
compPropInput.propertyIds[1].id = prop
n = REQUEST ( "Component_Property_Values_Of_Parent", compPropInput, compPropVals)
if n > 0 & compPropVals.propertyValues[1].value_status = 1 then
text2 0, i, compPropVals.propertyValues[1].value[1]
else
text2 0, i, "no value"
endif
next i
endif
2023-05-16 09:33 AM
Hello,
I have a question about the Temperature Label: is the position of the object automatic or do you have to place it by hand?
I was wondering about the ability of a GDL label to find the geometry of a wall and position itself in relation to it.
2023-05-22 02:29 PM
Hi,
the wall reference line is available as LABEL_ASSOC_ELEM_GEOMETRY .
A label can draw at given coordinates if the pointer is turned off, otherwise the drawing will be moved to the end of the pointer.
Use this code to transform from label coordinate system to project coordinate system:
! ------------------------------------------------------------------------------
! Transform from label local coordinate system to plan orientation and origin
! ------------------------------------------------------------------------------
rotBy = -LABEL_ROTANGLE
_unused = REQUEST ("View_Rotangle", "", angleViewRot)
corr = 0
if AC_bLabelAlwaysReadable & (AC_LabelOrientation = 1 | AC_LabelOrientation = 2 | AC_LabelOrientation = 5) then
summarot = (LABEL_ROTANGLE + angleViewRot) % 360
if summarot > 90 & summarot <= 270 then corr = 180
endif
rot2 rotBy + corr
add2 -LABEL_POSITION [1][1], -LABEL_POSITION [1][2]
2024-04-11 08:54 PM
Hi @Peter Baksa. Your script
dict collectComponents
collectComponents.collectMode = 1
dict outputCompIds
n = REQUEST ("Component_IDs_Of_Parent", collectComponents, outputCompIds)
if n > 0 then
for i = 1 to vardim1(outputCompIds.componentIds)
dict compPropInput, compPropVals
compPropInput.componentId.id = outputCompIds.componentIds[i].id ! THIS ARRAY ORDER IS DIFFERENT FROM Profile_component_info REQUEST RESULT.
compPropInput.propertyIds[1].id = prop
n = REQUEST ( "Component_Property_Values_Of_Parent", compPropInput, compPropVals)
if n > 0 & compPropVals.propertyValues[1].value_status = 1 then
text2 0, i, compPropVals.propertyValues[1].value[1]
else
text2 0, i, "no value"
endif
next i
endifHow to make UI where user can choose component of which some properties will be displllayed.
for complex structure it works with WALL_SKINS_BMAT_NAMES[i][1]
I mean order of collected bmats in compPropInput.propertyIds is the same like in WALL_SKINS_BMAT_NAMES[i][1]
but for Complex profile when request (Profile_component_info) order of collected bmats is based on bmat index number so its different.
Hence its impossible to use it in ie ui_radiobutton or option value list.
Is that clear? I attached Label object based on Your code. Hope You can help me. I got stuck with a job 😕
Thursday
Hello,
I am creating a GDL object in Archicad 28, and its parts consist of several building materials.
Is it possible to retrieve the properties of those building materials and use them as parameters in GDL?
For example:
My object consists of three parts, each made of a different building material.
In the Parameters, I have building_material_1, building_material_2, and building_material_3.
In GDL, I would like to calculate the total weight of my object — let’s call the parameter total_weight.
I have created additional parameters: density_material_1, density_material_2, and density_material_3.
In the end, I will calculate:
total_weight = (volume_1 * density_material_1) + (volume_2 * density_material_2) + ...
In the Building Material attributes, I can set the density of each material.
Is it possible to retrieve the density automatically from the building material properties, so that I don’t have to fill them in manually in the parameters?
I am not familiar with the “REQUEST” options at all. Is this something that could be used for this purpose, or is there any other way to get this information from the building materials — or is it simply not possible?
(Honestly, I find the GDL Reference Guide rather confusing. I need to see specific examples to really understand how things work.)
Thank you!