Copy Excel Data into a "choose from a list" Attribute

Hi
I wanted to choose a color for a dynamic component. Therefore I created a custom attribute and I filled in the list with all the colors and what I want to name them.

Is there a possibility instead of typing them in by hand to copy paste the list out of excel?
It would make live easier and less mistakes.

-->

Please read the explanation for the use of the DC Material attribute …
bottom of page:
https://help.sketchup.com/en/sketchup/dynamic-component-predefined-attributes

Ie … your values will be causing issues, especially if the end users do not have those color material (.skm) files installed.

To answer the question …

You’d have to create a macro or a function in Excel to concatenate all the colors …
"&" + A2 + "=" + C2 + "&"<<A3 + "=" + C3 … + “&”

For some reason the data needs a closing “&”.

Probably it would be easier to have another column (say D) where each line is concatenated … ie
"&White=White_Brabantia"
"&Almond=Almond"
… then in column D below the list, concatenate the cells in that column and add a closing "&".

You can then select the contents of that concat’d cell and paste into the SU DC Component Wizard dialog.

Thanks for your help. I still don’t quite get it.
I can concatenate the columns as required. What does the final line of text need to look like which I copy into SU?
is it “&White=White_Brabantia”&Almond=Almond"&Passion Red=Passion_Red"&…&"
or is it “&“White”=“White_Brabantia”&“Almond”=“Almond”&“Passion Red”=“Passion_Red”&…”&"

Also where do I copy it? Here:


Or Here?

Thats true. That’s why i followed the instructions and I added the materials in a small swatch at the bottom of the DC. So all the materials should be with the end user in the end.

NO omit the quote characters. Ie, it is one long text string.

Ok so like this:
&White=White_Brabantia&Almond=Almond&Passion Red=Passion_Red&…&

1 Like

Yup. That it.

OK the excel part is no problem.
But where do I copy now this line?

Into the “colour” field perhaps ? (EDIT nope, it goes in a hidden attribute. see below.)

There is an example component “Cafe Table” in the “Dynamic Components Training” folder (collection) that comes with SketchUp. It shows how a DC is set up so users can choose colors for teh base and the table top.

I tried it here but that didn’t work

Oh no, … I’m sorry, you need to use an attribute inspector extension.
I use Aerilius’ Attribute Inspector. Get it in the Extension Warehouse.

You actually paste the options into a hidden field in the DC dictionary.
It would be called "_colour_options" (if your custom attribute is named "colour".)

image

Thanks, after restarting everything it was all there and I copied it in.

Now it works. Great. :smiley: :smiley:

1 Like