繁體 简体

Q&A: 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
– somehow 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

If we think in terms of an “order or precedence” for color properties, we can make sense of what we are observing:

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

I believe the object you have imported has a color applied to the edges. I can’t speak for every CAD program, but I suspect this is the behavior of the CAD program where you exported this file.

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.

The problem is that TracePro only has User Interface capabilities for applying color to an object or a surface, but not an edge. Since the hypothesis is that the edge color takes precedence, and there is no way to change it in TracePro, the color seems to be “stuck”.

The second part of the explanation is that different colors are displayed for Silhouette View vs Render View. In Render, you see surfaces but not edges (so a color applied to an edge is ignored). In Silhouette, the edge color can be displayed (and will take precedence if it differs from the surface color).

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.

We also received these suggestions from a TracePro customer:

In case other TracePro users complain about this issue, I found two possible workarounds.

A. Import the STEP file into TracePro, export it back to a new STEP and
re-import this new file. This removes all color information. The drawback
is that all the objects lose their names in the process and are simply
numbered instead.

B. 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)

Best regards,

PS – Opening the STEP file in a text editor confirms your suggestion about
the *edges* being colored.

30051 新竹市經國路二段160號9F-8
Tel : 03-5359299  Fax: 03-5358908
統編: 28521213

光學軟體設計領導者

© 2018 All rights reserved. Setup by Eidea