Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Visual Style - every part with different color

Visual Style - every part with different color

Most of the companies are designing their CAD models with realistic colors today.

Unfortunately, it is not always possible to differentiate the parts from each other in assemblies.

Creating special view representations is not an option since this have to be re-done for each assembly and for each "real" view representation.

 

So please create a new visual style, where each part (or each assembly occurrence) gets an unique color.

 

Example with realistic colorsExample with realistic colorsExample with falsified colorsExample with falsified colorsNew visual styleNew visual style

30 Comments
stuarts
Advocate

 

The ability to apply component colour cycling to multibodies and assemblies like fusion.

 

fusion 1.jpg              

 

     After toggle                                                                                                                                 Before Toggle

 

fusion.jpgfusion 2.jpg

 

Applies a different color to each component to help differentiate between them.

When component color cycling is applied, each component receives a different color.

The colors used on components matches the colors used in the browser and time line when Component Color Swatch is ON.

Reference: Fusion Help

Adding the colour to the body and features like fusion would also be really beneficial.

fusion 4.jpgfusion 3.jpg

 

Thanks

Stuart

yevheniizh
Advocate

It will be so useful !! Nice idea !

cyril.wuethrich
Explorer

That would be a great idea to differentiate various components in a more complex assembly.

jtylerbc
Mentor
We do this for all of our weldments, and have for years, using View Representations. More recently we have added some iLogic to help set the components to the correct Representations quicker, but we used this method for a long time without that additional support. We have the typical Representations already created in our part and assembly template files. Generally all I have to do is set the desired color in the "Color Coded" representation for the parts. Then I activate the respective part Representation in each assembly Representation (this is the part of the process that the iLogic shortcuts were written to speed up). In rare cases where an item is not to be painted our standard company equipment color, I may also have to edit the part's color in the "Painted" Representation. This occurs infrequently, and is often a loose part of some sort. Most of our equipment is painted red. If we have loose components (special tools, shims, etc.) that are stored on the equipment, we often paint them white to make it more visually obvious when they are missing. We have several different part templates for starting out with commonly drawn plate or sheet metal shapes. These templates, along with all of our custom structural steel families in Content Center, have been set up with differing colors. This reduces the amount of manual color changes required, and in some very simple assemblies eliminates it entirely. Considering that I do it pretty much every day, I'm not sure I agree that it is impractical. However, I don't know your application, so maybe you have specific needs that don't apply to my company that make it so.
jtylerbc
Mentor
Sorry for the "wall of text" look of that post - I had paragraphs, but they were stripped out for some reason when I submitted the post, and it won't let me edit.
aaron.tw
Alumni
Hi All- Apologies that we're forcing you into writing "wall of text style" we're currently experiencing an issue with forums that is affecting our text editor. It should be fixed soon.
eelrod
Contributor

 I really like this idea. Most times I can make it with realistic colors and it's no problem, but occasionally I need to present designs for review (sometimes remotely) and it would be nice to have such an easy option of making parts different colors. In my case, I like to have different colors for the expediency of the discussion; it's much easier to say "the red part" than "the part at the end next to the large radius... no, the other radius... yes, that's it".

jeffsteiger6735
Advocate

"Hi All- Apologies that we're forcing you into writing "wall of text style" we're currently experiencing an issue with forums that is affecting our text editor. It should be fixed soon."

 

In conjunction with the Inventor "text editor" ?  🙂

 

leowarren34
Mentor

Haha @jeffsteiger6735 

Definitely need this!

Nickefth
Contributor

Definitely need this. Whenever I present an assembly at meetings, I always make all the parts different colors (and not realistic ones) to emphasize differences. Especially for non-technical people, they can't see the difference without it. 

 

As a possible addition to this, I usually have preferred colors for certain things. E.g. my compression springs are ALWAYS orange. Dowels are always red, fasteners purple, etc.... So I'd suggest having the visual style able to differentiate between items in the same folder. If I have a "fasteners" folder in the browser, the style would recognize that and color all of them the same color. 

 

Either way, I am all for this. Absolute must in the new release. 

leowarren34
Mentor

If not a view point then atleast a way of grouping parts and selecting a view, so you can easily toggle between the two.

tdant
Advocate

In the interest of faking it til we make it, I whipped up a quick VBA macro that creates a view representations to mimic the desired behavior:

Sub UniqueColorRep()
    Dim topAsm As AssemblyDocument
    Set topAsm = ThisApplication.ActiveDocument
    
    Dim trans As Transaction
    Set trans = ThisApplication.TransactionManager.StartTransaction(topAsm, "Unique Colors")
    
    Dim ucRep As DesignViewRepresentation
    
    On Error GoTo CreateDV
    Set ucRep = topAsm.ComponentDefinition.RepresentationsManager.DesignViewRepresentations("Unique Colors")
    On Error GoTo 0
    
    ucRep.Activate
    
    Dim compOcc As ComponentOccurrence
    For Each compOcc In topAsm.ComponentDefinition.Occurrences
        Dim uAppearance As Asset
        Set uAppearance = topAsm.Assets.Add(kAssetTypeAppearance, "Generic", "appearances")
        
        Dim uColor As ColorAssetValue
        Set uColor = uAppearance.Item("generic_diffuse")
        uColor.Value = ThisApplication.TransientObjects.CreateColor(RNG(), RNG(), RNG())
        
        compOcc.Appearance = uAppearance
    Next
    
    trans.End
    
    Exit Sub
    
CreateDV:
    Set ucRep = topAsm.ComponentDefinition.RepresentationsManager.DesignViewRepresentations.Add("Unique Colors")
    Resume Next
End Sub

The colors generated are as random as a computer can be, so if you don't like the first result, rerun the macro to overwrite with different colors.

leowarren34
Mentor

Very nice @tdant!

tdant
Advocate

I guess I should also include the RNG function:

Function RNG() As Long
    Randomize
    RNG = Round(Rnd * 255, 0)
End Function
leowarren34
Mentor

Hehe! @tdant 

newcomer
Advocate

The problem with color is that it is fixed.  That is, if I make a face green, it is green forever, and if I have fillets, then I might have to change several dozen (usually tiny) faces to change it to red.

 

Instead, I should be able to use a "color dictionary".  I assign a name ("case outside") and map it to a color ("glossy - black).  If later, I want it to be yellow, I change the color dictionary entry for "case outside" and everything that had used the "case outside" color changes color.  This would make it possible for third-party developers to assign colors via a dictionary.  I should then be able to save a color dictionary by name (so each drawing can have multiple color dictionaries) and label them with names like "Master" (lots of realistic colors), "Editing" (lots of contrasting colors so features don't get lost visually), "ECO change" (only the parts that changed are in yellow; everything else is in gray).  I can then select which color dictionary I am going to use for a given rendering.

clint.brown
Advocate

@tdant thanks for posting the VBA code! 

I've adapted it to work as an iLogic rule, below is an animated GIF showing it working.

Code can be downloaded here: https://clintbrown.co.uk/2019/05/04/ilogic-set-every-part-to-a-different-colour/

Clint Brown iLogic random-colours.gif

 

Hello,

 

@clint.brown, I don't get the iLogic to run on INV2017. Do I have to translate any parameters as I'm using the german INV-version?

 

Or is there some new objecttype in use whitch isn't accesable in 2017?

 

Regards

 

Frederik

clint.brown
Advocate

Hi @frederik.vollbrecht I have tested this in 2020 and 2019 with no problem (both English Versions). I don't believe that language is an issue here. The only time I have seen errors, is when an assembly has unresolved components. It is possible that something in the code is not exposed in the 2017 API, as stated in the blog post, I did not write the original code, I merely ported it to iLogic, it was originally posted as a VBA macro by @tdant@tdant can you shed any light on this?  

tdant
Advocate

@frederik.vollbrecht, try using the VBA code instead of iLogic. Whatever the error is, you'll get a popup that will tell us more about what exactly is going wrong. Screenshot that error window and post it here.

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report