Attribute Color Changed Dynamically

Attribute Color Changed Dynamically

ianwill93
Contributor Contributor
3,788 Views
20 Replies
Message 1 of 21

Attribute Color Changed Dynamically

ianwill93
Contributor
Contributor

Well this seems to be an unanswered question in this forum's history,

 

Is it possible to change the assigned color of an attribute dynamically?

Like perhaps using a Visibility States?

 

To give some context, I am designing a game machine that has 2 different models that I will have within 1 DB.

One of the attributes inserted into the block needs to change color based off of the model in use.

 

From the tinkering i've done, I havent seen anyway of doing this...

 

I apologize if this has been answered before and I just missed it in my searches.

 

Thanks for any help provided!

0 Likes
Accepted solutions (1)
3,789 Views
20 Replies
Replies (20)
Message 2 of 21

Anonymous
Not applicable

Hey,

 

Will it be what you want if set the colour of attrib "ByBlock"?

 

If not, let us know so guys here will work on it. I haven't done this by visibility but ALMOST anything is possible with dynamic blocks.

 

Regards,

 

Block Colour.jpg

0 Likes
Message 3 of 21

ianwill93
Contributor
Contributor

No for me that's as good as manually changing the layer that the block is on.


I was hoping to perhaps automate the process of the color changing. At the moment, the machine block has various models within it defined by Visibility states.

I would like the color to change with the switch to a new "model".

 

Hopefully that makes sense.

 

If layer switching is the only way to do this, then I can already do it that way.

0 Likes
Message 4 of 21

ojuris
Advisor
Advisor
Accepted solution

hi!

 

try this. You can change text in properties window. Don't forget use REGEN

 

Regards

Juris

Message 5 of 21

ianwill93
Contributor
Contributor

Yes that is the way I currently do it, but my question was if it can be more automated.


That still requires me to both change the visiblity state, and then change the color of the attribute.

I was wondering if we could've eliminated the step of changing the color by somehow attaching to the "model" of machine in use.

 

 

0 Likes
Message 6 of 21

ianwill93
Contributor
Contributor

I should add that I have no issues with changing layers or changing the properties.

 

My reason for wanting more automation is simply for those in the company who can only access the move command on a good day....

 

I gave them a grip to click to change visibility states (the model of machine) and i'd like that to also change the color of 1 attribute at the same time.

 

0 Likes
Message 7 of 21

Libbya
Mentor
Mentor

@ianwill93 wrote:

That still requires me to both change the visiblity state, and then change the color of the attribute.

I was wondering if we could've eliminated the step of changing the color by somehow attaching to the "model" of machine in use.

 

 


Nope, it doesn't.  The file Ojuris posted changes the visibility state and the color of the attribute at the same time.

0 Likes
Message 8 of 21

ianwill93
Contributor
Contributor

Oh wow thanks!

 

I'm sorry I didnt even see the attachment there.

 

Yes that is exactly what I was looking for! Now how do you do it? Smiley Happy

 

(Edit: Sorry that is a block with 3 different texts that have seperate colors.)

 

 

 

0 Likes
Message 9 of 21

ianwill93
Contributor
Contributor

Oh ok so this is actually text with the attributes all being invisible.

I got it. Well I may be able to make this work.

 

Thanks for the idea.

If anyone does know how to change the color of Attributes specifically, I'd love to hear some ideas.

0 Likes
Message 10 of 21

Anonymous
Not applicable

Hey,

 

Glad you found your answer.

 

Please select the post that answered your question as a solution and if you want give the author of that post a kudo to cheer them up 🙂

 

I underestand you are still waiting for specific solution.

 

Cheers,

 

0 Likes
Message 11 of 21

ojuris
Advisor
Advisor

hi

 

perhaps you could clarify what exactly is needed?

may be some example?

0 Likes
Message 12 of 21

ianwill93
Contributor
Contributor

Yes I can.

 

Basically I would like to make the color of an attribute change based off of visibility states WITHOUT duplicating the attribute name.

That way the value can be properly entered into a Table or Extracted.

 

Attached is an example WITH a duplicated attribute. If someone has a better solution I'd love to know.

 

Or if someone knows how to place 2 copies of an attribute in 1 block then that would also be helpful.

0 Likes
Message 13 of 21

Libbya
Mentor
Mentor

I think you may still be misunderstanding the function of the block Ojuris posted.  In it, there is ONE attribute and three text objects.  Each of the text objects are a different color and contain a field referencing the attribute value.  If you change attribute value and regen, the three fields update to the new attribute value.  The visibility state controls which text object is displayed and consequently the color of the displayed text that shows the value of the single attribute. How does that differ from the functionality you desire? 

0 Likes
Message 14 of 21

ianwill93
Contributor
Contributor

I most certainly did misunderstand.


He even posted "dont forget to regen"

Hahaha wow! Yes i'll be marking that as the solution!

 

Now how is the value of the text linked to the attribute?!

0 Likes
Message 15 of 21

Libbya
Mentor
Mentor

Within block editor, within the text object, right click and select Insert Field.  Field category should be Object.  For Object type, use the little selection tool on the right and select the attribute.  Under Property, select Value. 

0 Likes
Message 16 of 21

ianwill93
Contributor
Contributor

Wow thanks so much guys!

 

Very cool!

Always appreciate learning how to do something new!

 

0 Likes
Message 17 of 21

Libbya
Mentor
Mentor

I'm sorry, I gave the wrong procedure for the field in a text object.  Here's the correct one.

 

In model space, select the block, right click, edit attributes.  At the bottom under Value, right click and select Insert Field.  For Field category select Object.  Under Object Type use the selection tool and select the block.  Under Property select the Attribute name.  At the bottom of the screen select the field expression and copy it to your clipboard.  Exit the field/attribute editor.  Select the block, enter block editor, select the text object, paste the field expression, save the changes.   

Message 18 of 21

ojuris
Advisor
Advisor

exactly

0 Likes
Message 19 of 21

ianwill93
Contributor
Contributor

Hahaha yeah I tried the original and it wouldnt update with the reference, I eventually figured out that it was looking up the default value only.

 

Thank you all for your help!

Message 20 of 21

tom.buhler
Contributor
Contributor

Hi all,

 

I followed the steps shown but if I insert a second same-block or copy the first block, then all of the blocks only show the value of the first block's attributes. Is this the correct behavior? Is there a different field reference that would fix this? Maybe there is a way to change the field expression to include a diesel expression to extract the current objects id number and insert that into the copied expression in the text fields?

0 Likes