FamilyInstance.ByGeometry Material

Not quite sure how the material attribution works for this.
I have tried both to have the material available in the template and in the main family where I run the script and, in both cases, the material is not applied to the solid.
At the same time if in the template a Subcategory is already available the node produces an error.
@solamour or someone else in the forum can please explain a little bit better how this node is supposed to work?

The code is here so I bet you can investigate :slight_smile:

Exactly…on the paper it should apply a material if it is available in the new created document (based on the supplied template)
Doubt: the material parameter is of type ElementId and the method uses a SetParameterValue providing the name of the material only. I would probably find the ID of the material based on the name and then apply that as ElementId or apply the FirstOrDefault() if not found

For the SubCategory should check if the subcategory exists in the template before creating a new one otherwise there is no point in using a template.
Any thoughts? Do I need to go and build my own (we try to avoid third party packages in our scripts).

Cheers

Spring nodes has one too (python)

@ziyun.shang are you able to provide any insight to Cesare here? :slight_smile:

Tested and doesn’t apply the material as well

Try again, both material and subcategory should work. You need to supply the material’s name as a string and make sure that a material with that name exists in the family template:

The builtin node wasn’t a one-to-one translation and that’s why this node is still around.

1 Like