Setting a common dynamic attribute

Hi All,
Just starting with Dynamic Components. Can you have multiple IF statements in the hidden or material attributes?

Is it possible to format the code in these attributes eg


instead of one monolithic line of code?


Yes you can nest if functions.

They are not actually statements so I’m not sure that line breaks will have any benefit. Does the DC interface expand functions cells when you use line breaks ?

Hi Dan,

I have managed to do what I want through a massive complicated nested IF STATEMENT. I was hoping that I could separate out the clauses with something like a semi-colon in between them and that it would evaluate top to bottom.

When you end up with


It isn’t pretty that is why I was hoping that there was a way to format it within the attribute.

Do you know of a way to improve the look of the input screen so that attributes can be grouped together non alphabetically with separators such as lines in between them?


IF(nesting_of_IF_statements>2, use CHOOSE, use IF)
Meaning, check out the OPTIONINDEX or CHOOSE functions.

1 Like

Not specifically. But the dialogs are web interfaces whose layout is controlled by CSS. You could tweak the CSS if you know how. You’d need to keep backups as the next time the DC extensions updates the files would get overwritten.

1 Like

Thanks Dan. I appreciate your help.

I also wanted to introduce order in settings window - hoping for at least minimum control over “User Interface” if you get my view. For writing the overall dynamic attributes - when it contains useful data I use custom names that are working for my brain, like A00_BOXNAME - user sets name and then it represents attribute THE ACTUAL UNIT NAME. I change it all the time for maintaining cabinet count (base units, sink units, wall units etc.), so my cutlists have all parts organised for a project by a cabinet name.
Whenever I type a formula for any nested parts I recall parent!name, which in attribute window is basically =A00_BOXNAME. See my point? That way I can see the drawer side on my workbench, if labeled XYZ/B3/600/SL_DR would mean I’ve got a SIDE LEFT of a DRAWER / in unit B3 / It’s width is 600 / Project name is XYZ. This makes work so much faster.

In formulas I shorten attribute names using for example parent!h → which recalls to parent height which is set up by user in (BOX_H visible to user as edit box) but in attribute window there is just another one called H with value =BOX_H, same goes for multiple things, like TH = parent!box_th, or in a drawer th=parent!dr_th & parents dr_th would be like C04_DR_TH visible to user in “drawer settings” group of settings in the settings window.

So to sum up, the most important things:
I name attributes starting with A00, then if I want to add some detail and not end up somewhere counterintuitive, but rather next to what it corresponds with, I simply name new atributes A01, A02 and so on… Groups are divided by a letter in my case, so could be B00, C00, and so on for each attribute name.
Also using two zeros instead of just one lets you slide in between - if some were named for example A4 + A5 you would not have that possibility. They are alphabetically sorted. I hope my thoughts are easy to follow. Please give me another coffee, it’s already 6am and I’m still typing.

This method should help keeping it nicer. Get creative with it and show us some results if you like.
Also there is Cabinet Sense Attributes plugin and you may want to check it out (not advertising, haven’t found it useful enough / necessary in my case)

I hope that helps, let me know if u want to learn some more tips. I am thinking of starting up a YT/Patreon with furniture oriented videos and components + online help with setting up libraries for companies, also woodworking videos of how it can then be transfered over to a cnc or a company to cut up raw sheets and label them. This can apply to multiple trades I think, so my goal is to learn this whole Ruby bullshit and finally write my very first plugin Simply to overcome the hideous task of designing components with native software and getting my skills up to spend less time working.


Thank you Karol for this is the very detailed response. In the end, I did set it up exactly in this way. Being an ex-programmer, I have come across this issue before. It is a pain in terms of referencing the variables in formulae though. It’s just sad that these little issues that would take a small amount of time to fix never seem to get addressed. I was horrified to see that you can’t easily change the same variable value across a number of instances. It took the genius that is TIG to write me a very complicated script to do it.