Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to request a building material name?

Akira Ishida
Participant
I want to display the building_material used for the element in text.

n = REQUEST ("Name_of_building_material", index, name)
text2 0,0, name

Archicad24 doesn't seem to work with the above script.
The building material name will be "undefined".
Please tell me the solution
9 REPLIES 9

Barry Kelly
Moderator
You have to supply the index number of an actual building material, otherwise it doesn't know which one you want.

i.e.
n = REQUEST ("Name_of_building_material", 100, name)
text2 0,0, name
Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Akira Ishida
Participant
Thank you for your answer.
I found that I had to enter the index number when using this request command.

What command should I use to read the building material of an element and display it in text when the label is placed?

Podolsky
Newcomer
This one is a little bit tricky.
First, your element can have several Building Materials - if it's a composite wall, slab, or roof.
Second - you need to determine first in your label script - what is the element - is it fill, slab, roof, wall, beam, etc. For that, you need to use the global variable GLOB_ELEM_TYPE.
After your label script knows to which element is attached, it can scan receive building material name from another global variable:
WALL_BMAT_NAME or WALL_SKINS_BMAT_NAMES
COLU_CORE_BMAT or COLU_VENEER_BMAT
etc.
You can find the list of global variables at the end of the GDL Manual in the section Miscellaneous.

With GDL objects even more complicated - you need to request variable value from the script and receive building material name via
n = REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)

Akira Ishida
Participant
Thank you for your answer.

I was able to confirm the operation of the label.
(If I actually use this, I need a little more ingenuity.)

By the way, can I load the building material into the object in the same way when the subtype is "model element"?
BMAT_information = ""

!5 -WALL
IF GLOB_ELEM_TYPE = 5 THEN
	IF WALL_SKINS_NUMBER = 0 THEN
		BMAT_information = WALL_BMAT_NAME

	ELSE
		BMAT_information = WALL_SKINS_BMAT_NAMES[1][1]
	ENDIF
ENDIF

!6 -COLUMN
IF GLOB_ELEM_TYPE = 6 THEN
	BMAT_information = COLU_VENEER_BMAT_NAME
ENDIF

!7 -SLUB
IF GLOB_ELEM_TYPE = 7 THEN
	IF SLAB_SKINS_NUMBER = 0 THEN
		BMAT_information = SLAB_BMAT_NAME
	ELSE
		BMAT_information = SLAB_SKINS_BMAT_NAMES[1][1]
	ENDIF
ENDIF

!8 -ROOF
IF GLOB_ELEM_TYPE = 8 THEN
	BMAT_information = ROOF_BMAT_NAME
ENDIF

!12 -BEAM
IF GLOB_ELEM_TYPE = 12 THEN
	BMAT_information = BEAM_BMAT_NAME
ENDIF

TEXT2 0,0,BMAT_information

Podolsky
Newcomer
Script looks OK.

I didn't get your last question.
To receive Building Material name from the object you need to use this script:

!1 -OBJECT
IF GLOB_ELEM_TYPE = 1 THEN
	n = REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)
        IF n AND type = 16 THEN BMAT_Information = p_values
ENDIF

where expr - the name of the parameter in the object, related to Building Material.

Don't forget to define fill for the label. It's useful when you do 2D details. The attached example is showing a custom-made label, that defines Building Material names on details.

furtonb
Enthusiast
Somewhat related: is there a way to request user-made property values of a building material?
E.g. I define the vapour resistance of a material, which is not part of the "normal" building physics properties...
actively using: AC22-25 INT | Rhino6-7 | macOS / win10

Peter Baksa
Graphisoft
Graphisoft
furtonb wrote:
Somewhat related: is there a way to request user-made property values of a building material?
E.g. I define the vapour resistance of a material, which is not part of the "normal" building physics properties...
REQUEST "Component_Properties_Of_Parent"?

The Archicad Library uses this in Component Classification and Properties Label.
Péter Baksa
Software Engineer, Library as a Platform
GRAPHISOFT SE, Budapest

gdford
Booster
There is not an off-the-shelf way to do this with autotext.
I suppose with GDL it could be done, but the solution for this should come out of the box.
Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-25
Win 10 - ASUSTeK Zephyrus M GU502GV - 64 bit
Intel(R) Core(TM) i7-9750H CPU @ 2.60 GHz
16.0 GB ram

furtonb
Enthusiast
I agree. The most comprehensive access to properties/GDL parameters is within the interactive schedule criteria and field list. It would be useful to have the same access depth in autotext labels.

Another issue is extracting sub-element information: with hierarchial elements (curtain walls, railings) you can press tab to get a level deeper and annotate CW panels, etc., but with composites I cannot do that AFAIK.

E.g. you have a composite wall and you want to annotate the manufacturer and description of the core - which is something you define at the bMat level.
actively using: AC22-25 INT | Rhino6-7 | macOS / win10

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!