**Change color of a face for an isolated solid in a body**
**Change color of a face for an isolated solid in a body**
(OP)
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
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





RE: **Change color of a face for an isolated solid in a body**
Is it a v4 model imported in v5? Do you have a specific name for that body? Better a sample uploaded...and is easier to change the color for the whole body instead of a single face if is without "history"...
I saw that you are interested in automation. Did you tried something?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: **Change color of a face for an isolated solid in a body**
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
RE: **Change color of a face for an isolated solid in a body**
right click on one of them, properties
there is a color option there
RE: **Change color of a face for an isolated solid in a body**
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
RE: **Change color of a face for an isolated solid in a body**
RE: **Change color of a face for an isolated solid in a body**
If you plan to use this only once, then you might not need a script.
indocti discant et ament meminisse periti
RE: **Change color of a face for an isolated solid in a body**
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.