Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

**Change color of a face for an isolated solid in a body**

Status
Not open for further replies.

vikt

Mechanical
Mar 13, 2013
52
US
Hi Friends,
There is an isolated body say a rectangular block under part body.
I would like to change the color of a single face.
Let me know if you guys can help me with a macro for that.

Actually my requirement is to change the color of all the faces for that block.
And i have to do it for 300 blocks in 300 part bodies.
Please reply if you need any more details.

Thanks
vikt
 
Replies continue below

Recommended for you

no it is v5 only, i just copy pasted the part body ( as result ) so it will
create a new body with an isolated body inside....
actually i m facing issue, i tried to manually select all body and change the color....
but i find it strange that its not changing, then i tried to select the individual face of each body...
its working, so i thought if there can be macro to select all the faces of body and change color...

vikt
 
ctrl-click all the desired bodies
right click on one of them, properties
there is a color option there
 
Hi,
Below is the code dat i tried.
I can access the isolated body using shape object.
But it wont help if i hv to select a face.

Sub ChangeColor()

Dim selection1 As Selection
Set selection1 = CATIA.ActiveDocument.Selection

Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim bodies1 As Bodies
Set bodies1 = part1.Bodies

Dim body1 As Body
Set body1 = bodies1.Item(2)

Dim hybridbodies1 As HybridBodies
Set hybridbodies1 = body1.HybridBodies

Dim shapes1 As Shapes
Set shapes1 = body1.Shapes

Dim shape1 As Shape
Set shape1 = shapes1.Item(1)

shape1.Name = "Vikt"

End Sub
 
you can search all faces and change the color.

If you plan to use this only once, then you might not need a script.

Eric N.
indocti discant et ament meminisse periti
 
hi guys, yeah i got it....
i searched with using filter as color (from element)
also i used include topology...it gave me all the faces for
all the part bodies in catia session with that color....

Thnks everybody for your suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top