Custom Material Attribute

Hello, I am looking to create a custom attribute called “Finish” that controls the material attribute.

The process would be, the user would select from a list a material from the custom attribute “Finish.” The material attribute would then equal the custom attribute “Finish.” However I have added a custom material as a test called “MDF” and in my custom attribute list “Finish” I have a value also called “MDF” I get the error saying this is not in the model? How do I solve this?

Examine the sample dynamic components that do this kind of thing.

The “Cafe Table” in the “Dynamic Components Training” folder is a good one to examine.

Also …

(You might find that a hidden swatch with all choices of material must be within the dynamic component.)

See:

1 Like

You also need a “Material” Behavior that points at the “Finish” attribute in the toplevel component.

Again, … examine the “ Cafe Table ” in the “ Dynamic Components Training ” folder.
(Look at the various “Top” subcomponents.)

Which one is the cafe table?

Materials must be already loaded in the model, you could insert a collection of 1" or 10mm square samples within the component for it to reference. Otherwise create a palette of groups which the user can paint and the Dc reference

1 Like

The issue I have is I can get it to work, manually, but when I go to elect a different finish from the list it remains unchanged

Then, please share your model

Another point, the DC may require a redraw to update, try right click menu, Dynamic Component, redraw. If this works, you can then trigger a redraw in the DC or set a short cut or script to do this

You can only use general names like ‘Green’ or ‘red’ , hexanumber (#203050) or the native ones from the standard library (not sure about the last)
If you wanna use your own, you must add them to the model (or as a swatch to the component,as described by @pcmoor)

Solved it in the end, deleted the steps I did and re-did them the same and it worked, I think the Ruby API is a little temperamental!

That would be the component with the name “Cafe Table” perhaps ?

3 Likes