Changing colour erases other custom attribute formulas

Hi everybody,

I’m just diving into making DC and I reached a point where I need help. (I guess that will happen more often in the future)
I have created a DC of a bin and added an on click function to show the bin packed or unpacked. I also added some other features like changing the colour and with a formula it also changes the article number. Everything works perfectly fine.
However I want to make now copies of this DC. Lets say there are 4 bins in the first row which are unpacked and there are two more rows packed items behind them. Now I want to change the colour of the bins in the first row and the ones behind them.
Instead of choosing every single component and changing the colour I mark up the component in the front row unpacked and the 2 packed components at the back. When I change now the colour (which is possible) it will erase the formula which I have in the Custom attribute for the Article number and it will not show the right number any more.

As I would like to run a report afterwards this quite a problem.

I attached the DC I created.

You help would be very much appreciated.
Thanks
3L_NI.skp (3.0 MB)
Test copies NewIcon_3L_DC.skp (4.3 MB)

1 Like

I see what you mean, if you try to change material across more than one component the formula for article_number is erased and replaced with the current value. however I have no idea why it is happening, sorry. Maybe @pcmoor can help?

Thanks for your answer.
If it would be for me it is no problem because I can adjust my workflow so it does not happen. However I’m trying to build a library for other users which are really basic users. So if this could be fixed it would be great.

Thanks for your effort


What is the purpose of Main_Design here? It seems to reference the parent attribute option, but also seems to serve no purpose, however removing it breaks the component… I would consider trying to simplify this, perhaps a clean rebuild would clear up the problem, sometimes starting over can be the best option. Enroth has an extension to remove all DC attributes, so you can use the same objects you have already spent time drawing.

https://extensions.sketchup.com/extension/0ecbb2a5-ba9d-4ed0-83df-38b0c5411c92/eneroth-de-dc-ify

Start simple with 2 colours and test each attribute as you add it across multiple copies to pin point where it gets messed up. Then at least you will know what is causing it, and we can try to find a work around. Attached a simplified version, changed a few formulas and material names, but the component creates a unique copy and breaks still, I’m stumped.

MODIFIED BIN2019.skp (3.0 MB)

Any custom attribute when exposed in the option dialog will be changed to the common selection for multiple selections. That is the selected values will be chosen, which would overwrite any formula. To avoid this hide any attribute you wish to preserve and use the component info attributes to report this in the option dialog. (I used itemcode)
component info.skp (3.1 MB)

1 Like

Hi
well as I have the on click attribute to show the product packed or unpacked I had to make 2 child comonents which change visibility. If I would only change the material in the parent component it would not change it in the child components. Therefore I added the Attributes in the child components as well and it worked. For me it didn’t make sense either because any colour in the child components set on default should change to the colour of the parent component I thought.

This was the first test of many products to follow. So I need to get this one right in order to have a kind of template for the other 500 :sweat_smile:

Thanks for your help

1 Like

Hi sounds good to me. only a stupid question now from my side: Where do I see the Item code now? I can’t find it in Component Options and also not in Entity Info Advanced Attributes.
I can see it in the Component Attributes box and it is set to be shown (there is only this option).

Sorry just found it
image

I would definitely optimise the box wrapper image…

your current png is 1.5 MB

EDIT: optimised png >> 648 KB


optimised jpg >> 250 KB


resized optimised jpg >> 73 KB

as a material in SU you will not perceive any visual difference, but file size and performance will be very different…

john

2 Likes

use

="<br>" & Article_Number

and it create a line break to make it clearer

1 Like

You are right. I wanted to do that but even when I use the hi res picture it shows like this


but even a low res picture shows better on screen.

I know this is a different topic but do you have a quick fix to this?

Great will do.

Thanks

I writing an extension to automatically optimise all textures in an existing model, so would use it…

however, for this example I extracted your original image and used ‘Image Shinker’ as a mac application…

It says you may be able to ‘build’ a windows version of it …

john

1 Like

Looking forward to your extension!
Thanks for helping

2 Likes