×
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

What is with Solidworks Color?
2

What is with Solidworks Color?

What is with Solidworks Color?

(OP)
Hello All,

I am wondering why there are so many ways to color something in solidworks. Alot of user's here color faces, then maybe a feature, then color it again in an assembly. I know that in 2006 this feature has been enhanced.

I try to tell the user's here to color the part and never in the assembly. Also within the part you can apply textures to faces, features, or bodies. The same goes for colors. I found a couple macros that will return all face colors and feature colors back to model color which helps somewhat. However these macros do not work with a Multi-bodied component.

Just curious if anyone else gets a headache when an in-experienced user is coloring things completly wrong.

Best Regards,
Jon

Challenges are what makes life interesting; overcoming them is what makes life meaningful.

Solidworks 2005 SP3.1

RE: What is with Solidworks Color?

I never re-color a part in an assy ... only in the part file. If I work in someone else's assy, I will remove the colors. There are macros that will do this.
I have not read/heard a reason to want to re-color a part in assy.

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP3.1 / PDMWorks 05
ctopher's home site (updated 06-21-05)

FAQ559-1100
FAQ559-716

RE: What is with Solidworks Color?

I think this usually happens because a user's options settings don't reveal the parts' color settings to show up in the context of an assembly.  Then people add colors in the assembly to get a rendering done.  Now you've got a mess.

Tools > Options is probably the best place to start to make sure everything visible in the part level is also visible in the assembly--so as not to tempt someone to add confusing colors that end up being difficult to manage later.


Jeff Mowry
www.industrialdesignhaus.com
Reality is no respecter of good intentions.

RE: What is with Solidworks Color?

I use "Model Properties" (not "Model Colors") from Lenny's website:
http://webpages.charter.net/mkikstra/SWX-macros.html
It will color an entire assembly, or just picked parts.  You can also remove feature colors.  

One of the users here colors the part at the assembly level, not the part level.  The reason behind this is that it is easy to spot the original in a part-pattern within an assembly.  

I prefer using different colors for configurations of a part because it makes it easy to spot the different configurations in an assembly (so I only set colors at the part level).  

Flores

RE: What is with Solidworks Color?

What is wrong coloring the parts in the assembly? Just because poor software sometimes forgets the colors doesn't break things...I am looking for a image to render, so I "paint" the assembly.

Should I go back to every part and subassembly and apply colors there instead?

3000 hours and counting on SW, 0 hours training

RE: What is with Solidworks Color?

Good point.  I think this is why SW revamped color tracking in 2006.  I'll be glad to see this fix, since I do a lot of work with pre-cluttered client files.


Jeff Mowry
www.industrialdesignhaus.com
Reality is no respecter of good intentions.

RE: What is with Solidworks Color?

2
I have this macro that is a combination of the RemoveColorsFromFeatures and RemoveColorsFromFaces macros. It also removes colors from all bodies in multi-body parts. One drawback is that you have to run it for each configuration.

Ken

CODE

'***************************************
' RemoveAllColorsFromPart.swp
'***************************************
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swSelData As SldWorks.SelectData
Dim swFeat As SldWorks.Feature
Dim vFaceArr As Variant
Dim vFace As Variant
Dim swFace As SldWorks.face2
Dim swEnt As SldWorks.entity
Dim Feature As Object
Dim vBodyArr As Variant
Dim vBody As Variant
Dim swBody As SldWorks.body2
Dim vMatProp As Variant
Dim Face As Object
Dim bStatus, AnyFeatures As Boolean
Dim iNumFeat, iCount1, nSelCount, RemainingFeatures As Integer
Dim sFeatName As String
Dim NumFeatures As Long
Dim FeatureName As String

Sub main()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager

If Not swModel.GetType = swDocPART Then
    bStatus = MsgBox("This program only works for Part files.", vbCritical)
    End
End If

swModel.ClearSelection2 True
RemainingFeatures = swModel.GetFeatureCount()

nSelCount = swSelMgr.GetSelectedObjectCount
swModel.ClearSelection2 True
AnyFeatures = False

'Use for all Surfaces
iNumFeat = swModel.GetFeatureCount
Set Feature = swModel.FirstFeature
For iCount1 = 1 To iNumFeat
    Feature.Select (True)
    Set swFeat = swSelMgr.GetSelectedObject5(1)
    Set swSelData = swSelMgr.CreateSelectData
    FeatureName = Feature.GetTypeName()
    Debug.Print FeatureName
    If FeatureName = "RefSurface" Then
        AnyFeatures = True
        vFaceArr = swFeat.GetFaces: If IsEmpty(vFaceArr) Then Exit Sub
        For Each vFace In vFaceArr
            Set swFace = vFace
            Set swEnt = swFace
            
            swEnt.Select4 True, swSelData
            swModel.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 1, ""
        Next
    End If
    swModel.ClearSelection2 True
    Set Feature = Feature.GetNextFeature()
Next iCount1

'Use for all (surfaces and solids) if one solid body is present
vBodyArr = swModel.GetBodies2(swAllBodies, False)
If Not IsEmpty(vBodyArr) Then
    For Each vBody In vBodyArr
        AnyFeatures = True
        Set swBody = vBody
        If Not vBody Is Nothing Then
            Set Face = vBody.GetFirstFace
            While Not Face Is Nothing
                bStatus = Face.Select(True)
                swModel.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 1, ""
                swModel.ClearSelection2 True
                Set Face = Face.GetNextFace
            Wend
            
            swModel.ClearSelection2 True
            iNumFeat = swModel.GetFeatureCount
            Set Feature = swModel.FirstFeature
            For iCount1 = 1 To iNumFeat
                If Feature.IsSuppressed = False Then
                    Feature.Select (True)
                    sFeatName = Feature.Name
                    swModel.SelectedFeatureProperties 0, 0, 0, 0, 0, 0, 0, 1, 0, sFeatName
                    swModel.ClearSelection2 True
                    Set Feature = Feature.GetNextFeature
                End If
            Next iCount1
        End If
    Next
End If

If AnyFeatures = True Then
    MsgBox ("Colors successfully removed from solid bodies and surfaces." & Chr(13) & Chr(13) & "You may need to run this for each configuration")
Else
    bStatus = MsgBox("Remove colors failed. This file probably doesn't contian any solid bodies or surfaces.", vbExclamation)
End If

swModel.ClearSelection2 True
End Sub

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