We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

"Component_IDs_Of_Parent" - How to get names of components?

greg_lupo
Booster

Hi Gdlers,

How to get names of building materials after using request:

n = REQUEST ( Component_IDs_Of_Parent collectComponents, outputCompIds)
outputCompIDs- return dictonary with some strange bmat ids that are not indexes nor guids and what is more in case of compllex profiles they are in different order than responses of  Profile_component_info

Help!

3 REPLIES 3
Peter Baksa
Graphisoft
Graphisoft

Hi,

 

Components have a building material, but they have a cross-section shape too, so they are different from building materials.

You can't get building material index from them, but the property Common / Name can be set for building materials, and shown as a component property.

 

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

But Properties in bmats cant be expressions so writing Common/Name has to be fill up by hand right?
From a label user the  aim was to have a list of components of complex profile, pick one and display its properties.

problem is that  request "Component_IDs_Of_Parent" returns dict with component ids (different than bmat indeces) but  also in different order than result  of  "Profile_component_info". Is there a automatic way to identify components with thier coresponding bmats?

 

Peter Baksa
Graphisoft
Graphisoft

Hi,

if it is enough to list skins that are actually cut by the floorplan cutplane:

 

dict collectComponents, outputCompIds
collectComponents.collectMode = 1
n = REQUEST ("Component_IDs_Of_Parent", collectComponents, outputCompIds)
if n > 0 then
	collectComponents.collectMode = 2
	n = REQUEST ("Component_IDs_Of_Parent", collectComponents, outputCompIds)

	for i = 1 to vardim1(outputCompIds.componentIds)
		text2 0, 0, outputCompIds.componentIds[i].id
		add2 0, -1
	next i
	del i - 1

	add2 2, 0
	for i = 1 to vardim1(WALL_SKINS_BMAT_NAMES)
		text2 0, 0, WALL_SKINS_PARAMS[i][18]
		add2 2, 0
		text2 0, 0, WALL_SKINS_BMAT_NAMES[i][1]
		del 1
		add2 0, -1
	next i
	del i - 1

	del 1
endif

 

collectComponents.collectMode = 2 gives result in the same order as WALL_SKINS_... globals (hiding data of uncut components).
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest