V5R19 - color of Join
V5R19 - color of Join
(OP)
Hi,
I would like to ask if somebody know how to keep surfaces colors when creating Join. Maybe there is a macro that can color the Join according to sources?
Regards
tomczakus72
I would like to ask if somebody know how to keep surfaces colors when creating Join. Maybe there is a macro that can color the Join according to sources?
Regards
tomczakus72





RE: V5R19 - color of Join
Regards,
Derek
Win XP64
R20SP7/21SP5, 3DVIA Composer 2013, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
RE: V5R19 - color of Join
I will try to work with federations. Normally I have to change colors manually and it's slow and boring.
Regards
RE: V5R19 - color of Join
Recently I had to do something like you wish, so here is the code in CATScript (you can comment some messages to decrease number of clicks). This macro can be used for any feature not only Join.
Sub CATmain ()
CATIA.DisplayFileAlerts = False
' What do you want to select
Dim EnableSelectionFor(0)
EnableSelectionFor(0) = "AnyObject"
' Reset the Selection
Set sSEL = CATIA.ActiveDocument.Selection
sSEL.Clear
' Define Selection
MsgBox "Please Select the FEATURE from which you want to get the color"
UserSelection = sSEL.SelectElement2(EnableSelectionFor, "Please Select the FEATURE from which you want to get the color", False)
' Evaluation if the selection is correct or not
If UserSelection <> "Normal" Then
MsgBox "Error with the selection"
Exit Sub
Else
'//////getting rgb color of a selected feature in the tree
Dim visProperties1 As VisProperty
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
Dim r, g, b
r = CLng(0)
g = CLng(0)
b = CLng(0)
visProperties1.GetRealColor r, g, b
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''#
' What do you want to select
Dim EnableSelectionFor1(0)
EnableSelectionFor1(0) = "AnyObject"
' Reset the Selection
Set sSEL1 = CATIA.ActiveDocument.Selection
sSEL1.Clear
' Define Selection
MsgBox "Please Select now the FEATURE which you want to give same color like previously selected"
UserSelection = sSEL.SelectElement2(EnableSelectionFor1, "Please Select now the FEATURE which you want to give same color like previously selected ", False)
' Evaluation if the selection is correct or not
If UserSelection <> "Normal" Then
MsgBox "Error with the selection"
Exit Sub
Else
'//////getting rgb color of a selected feature in the tree
Dim visProperties2 As VisProperty
Set visProperties2 = CATIA.ActiveDocument.Selection.VisProperties
visProperties2.SetRealColor r,g,b,1
End If
End If
End Sub
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: V5R19 - color of Join
Works well, but it's not exactly what I need. In my case I create Join from surfaces with different colors. Finally I use Join to cut solid. So the problem is more complex.
Regards
Maciej