CATIA SCRIPT FOR CHANGE COLORS
CATIA SCRIPT FOR CHANGE COLORS
(OP)
Hello everyone,
I created a script to change the colors of bodies but mistakenly I also changed all the other features.
this is the script text:
Sub CATMain()
'------------------------------------------------------
Dim sSel As Selection
Set sSel = CATIA.ActiveDocument.Selection
'show all MechanicalFeature
sSel.Search "CATPrtSearch.MechanicalFeature,all"
sSel.VisProperties.SetRealColor 210, 210, 255, 1
sSel.Clear
sSel.Search "CATPrtSearch.MechanicalFeature.Visibility=Invisible,all"
sSel.VisProperties.SetShow 0 '0visible
sSel.Clear
sSel.Search "CATProductSearch.Part.Visibility=Invisible,all"
sSel.VisProperties.SetShow catVisPropertyNoShowAttr
sSel.Clear
sSel.Search "CATAsmSearch.Product,all"
sSel.VisProperties.SetShow catVisPropertyShowAttr
sSel.VisProperties.SetRealColor Auto,Auto,Auto,Auto
sSel.VisProperties.SetRealOpacity 255, 1
sSel.Clear
sSel.Search "CATProductSearch.Part,all"
sSel.VisProperties.SetShow catVisPropertyShowAttr
sSel.VisProperties.SetRealColor 210, 210, 255, 1
sSel.VisProperties.SetRealOpacity 255, 1
sSel.Clear
'modify bodyfearure properties
sSel.Search "CATPrtSearch.BodyFeature,all"
sSel.VisProperties.SetShow catVisPropertyShowAttr
sSel.VisProperties.SetRealColor 210, 210, 255, 1 'grigio catia
sSel.VisProperties.SetRealOpacity 255, 1 '255 opaco-0 trasparente,
sSel.Clear
End Sub
Can you suggest me how can I reset all to the default colors? (In particular I need to reassign the original green color of constraints).
Thank you.
I created a script to change the colors of bodies but mistakenly I also changed all the other features.
this is the script text:
Sub CATMain()
'------------------------------------------------------
Dim sSel As Selection
Set sSel = CATIA.ActiveDocument.Selection
'show all MechanicalFeature
sSel.Search "CATPrtSearch.MechanicalFeature,all"
sSel.VisProperties.SetRealColor 210, 210, 255, 1
sSel.Clear
sSel.Search "CATPrtSearch.MechanicalFeature.Visibility=Invisible,all"
sSel.VisProperties.SetShow 0 '0visible
sSel.Clear
sSel.Search "CATProductSearch.Part.Visibility=Invisible,all"
sSel.VisProperties.SetShow catVisPropertyNoShowAttr
sSel.Clear
sSel.Search "CATAsmSearch.Product,all"
sSel.VisProperties.SetShow catVisPropertyShowAttr
sSel.VisProperties.SetRealColor Auto,Auto,Auto,Auto
sSel.VisProperties.SetRealOpacity 255, 1
sSel.Clear
sSel.Search "CATProductSearch.Part,all"
sSel.VisProperties.SetShow catVisPropertyShowAttr
sSel.VisProperties.SetRealColor 210, 210, 255, 1
sSel.VisProperties.SetRealOpacity 255, 1
sSel.Clear
'modify bodyfearure properties
sSel.Search "CATPrtSearch.BodyFeature,all"
sSel.VisProperties.SetShow catVisPropertyShowAttr
sSel.VisProperties.SetRealColor 210, 210, 255, 1 'grigio catia
sSel.VisProperties.SetRealOpacity 255, 1 '255 opaco-0 trasparente,
sSel.Clear
End Sub
Can you suggest me how can I reset all to the default colors? (In particular I need to reassign the original green color of constraints).
Thank you.





RE: CATIA SCRIPT FOR CHANGE COLORS
Search function of the forum is working very well, please check this link
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA SCRIPT FOR CHANGE COLORS
thank you for your answer. I tried your script indicated in the link above but the contraints color doesn't change.
Do you have another idea?
RE: CATIA SCRIPT FOR CHANGE COLORS
Did you tried also CATIA.Startcommand("Reset Properties") in a selection?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA SCRIPT FOR CHANGE COLORS
RE: CATIA SCRIPT FOR CHANGE COLORS
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA SCRIPT FOR CHANGE COLORS
What color are they after your script?
Can you upload a picture (plz use Upload image function) of the spec tree with the constraints?
indocti discant et ament meminisse periti
RE: CATIA SCRIPT FOR CHANGE COLORS
CODE --> code
and I don't understand why you push a color to the instances when on the lines above you set everything to auto, an you started with setting the color of body to the color you want...
Changing instances color does affect sketch constraints and wireframe (they all go black)
to go back to normal do:
CODE --> code
indocti discant et ament meminisse periti