Skip to content

Unable to change the color of an object imported from a CAD file

Question

I am unable to change the color of an object I imported into TracePro from a CAD file. How can this be resolved?

Synopsis

Unable to change the color of an object imported from a CAD file

Symptoms

OBSERVATION

- object imported from STEP file
- defined as pink in the STEP file
- I changed the object color to blue in TracePro, but it doesn't show
- the object is still displayed in pink. It seems like some other color attribute takes precedence over it.
- I, however, changed the color of Surface 0 to green and this does show. - Block1 - regular block object created in TracePro for comparison
- I made the object blue and it does show as expected.
- I made Surface 0 red and it does also show as expected.

EXPLANATION

There is an "order of precedence" for color properties. The color of higher precedence entities overrides the color on lower precedence ones. The order of precedence is:

1- Edge color
2- Surface color
3- Object color

The object you have imported has a color applied to the edges.

While it may not be immediately intuitive, this order of precedence makes sense and is useful. You can apply a color property to an object, but you might want one surface to be different for some reason. Using the same logic, you can apply a color to a surface but you might want one edge to be a different color than the rest of the surface.

Solution

I have two suggestions to deal with the problem.

You can make use of Render vs Silhouette view to view the edge colors or the surface colors.
The other solution is to modify these colors in the CAD program prior to export.

If all else fails, you can edit the colors in the STEP file "by hand." Before importing the file into TracePro, open the STEP file in a text editor, locate and delete the definition containing "MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION". This definition may span many lines depending on the number and complexity of the objects contained in the file. If there is only one simple object, it should span only one or two lines as in the example below, but if there are hundreds of complex objects with many surfaces, it can span hundreds of lines. Color definitions in the file then have no more effect and are unused but they don't need to be removed individually.

Example:
#217=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#23,#30,#37, #44,#51,#58,#65,#72,#79,#86,#93,#100,#15),#215); (If the two above lines are deleted from the STEP file, the imported objects no longer have any edge color)