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.
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 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?
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?
ht
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?
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?
Jeff Mowry
www.industrialdesignhaus.com
Reality is no respecter of good intentions.
RE: What is with Solidworks Color?
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