×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

V5R19 - color of Join

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

RE: V5R19 - color of Join

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

RE: V5R19 - color of Join

(OP)
Thanks.
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

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

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: V5R19 - color of Join

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources