Button that inserts m² of material in the component information, is it possible?

Its possible a button that inserts m² information of the materials present in the component.

For example, I select the component, click on the button, and it inserts into the component all the m² of the materials contained in it.

This is confusing. Where do you want the sum of the area inserted ?

For example, … “in the component information” is vague.
Do you mean the Dynamic Component attributes ? … or the Entity Info inspector ?

What if there are various materials assigned to the component’s faces or subcomponents ?

Hey Dan =D

In the dynamic component, it is to have the information in the component for when exporting in ifc.

It’s okay that there are different materials, it’s for use in building materials.

Similar to Fredo’s Label Report, but instead of creating a csv, it inserts the information into the component.

Well, yes it is possible. But the DC extension and it’s attributes are closed source.
It is a very steep learning curve to know how to add attributes correctly.

We’ve discussed this many times in the DC forum category.

So. Should each material used have it’s own attribute and it’s own total area ?

1 Like

I already studied about adding attributes, but I don’t know how to get the areas by material.
yes, that each separate material with its area.

The code will need to traverse the component’s entities checking for material assignments to instances and/or faces. This is done by checking the return value of an entity’s #material() method.

As you dig deeper into the instance paths you build an InstancePath which can give you the #transformation that will be needed to pass into the #area() method calls so that any scaled components will return the correct area values.

The digging is usually done with a recursive code object. (Either a Proc or Method that calls itself.)

As the component hierarchy is traversed, the cumulative material area(s) would be saved into a Hash structure, and when complete this hash would be saved as DC attributes.

There are some examples recursively “walking” the model (or component) hierarchy posted in this category already. Use the forum’s search feature.

1 Like