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!

V5R19 - color of Join

Status
Not open for further replies.

tomczakus72

Automotive
Jun 19, 2012
3
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
 
Replies continue below

Recommended for you

No sir. A join creates a new surface and this surface does not inherit the individual properties of the old group of surfaces. If you have the GSD license you can use Federation under the Join Command. There are a few options in that area for how the surfaces will be federated but in the end the federated areas will act a a single surface with many patches. If you want to fillet on the internal patches of the Federation you must logically group the federations with the tangency option. You can then make 1 selection to address color. Furthermore, the Federation will follow if you use the Part Design -- Split command.

Regards,
Derek


Win XP64
R20SP7/21SP5, 3DVIA Composer 2013, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
 
Thanks.
I will try to work with federations. Normally I have to change colors manually and it's slow and boring.
Regards
 
Hi,

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

 
Hi,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor