Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change surface color of multi-body solid part

Status
Not open for further replies.

Thosnow

Aerospace
Feb 23, 2017
68
Hello All,

I am able to change PartBody color with a VBA code but having difficulty to change the surface color of multi-body solid part, which has multiple bodies joined together.
When I want to change the "multi-body-PartBody"s color to white, the visible color of all surfaces did not change at all, unless you use the mouse and go to property of each surface on the body and change its color from there manually.

Any suggestions, code syntax, or CATIA command is much appreciated.

Thank you in advance

Quin
 
Replies continue below

Recommended for you

use the graphic properties wizard to understand where the color comes from.

2017-03-16_12-34-52_uzowvk.png


here the face is white even if all bodies and feature above have other color.

Eric N.
indocti discant et ament meminisse periti
 
So surface color and fill color are different? Is it right

Property visProperties.SetRealColor will change surface color or fill color?
As I understand visProperties.SetRealColor only changes surface color...is it right?

Quin
 
it change the color of the selection

Eric N.
indocti discant et ament meminisse periti
 
I agree with itsmyjob...but i used visProperties.SetRealColor to change partbody (in the selection) and visible/surface color did not change. See image below.

Capture_miq5m7.jpg


The above part has multiple surfaces (complex part but single body) with blue color and i tried to change to white with visProperties.SetRealColor 0, 0, 0, 1 but the color did not change to white at all.
However, if I use the same visProperties.SetRealColor 0, 0, 0, 1 to change surfaces on a simpler part then color changes as wanted.

Any idea?

Quin
 
use the property wizard to find out where the color comes from

priority is given to face, then shape, then body.

So if all faces are blue, you can change shape or body to white you will still see the solid blue.

Eric N.
indocti discant et ament meminisse periti
 
After running the macro, I still see "blue" color under "Fill" section in the wizard. Does it mean partbody color?

Quin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor