Hi all,
I was wondering if i can set the ambient lighting to 1 by default. its always at .54 for some reason and this is rather dark in some occasions
Hi all,
I was wondering if i can set the ambient lighting to 1 by default. its always at .54 for some reason and this is rather dark in some occasions
i talked about the problem of the bad DOT default settings (plus, it exist many differents DOT, not all the same)
here :
https://forum.solidworks.com/message/1057772?q=how%20is%20your%20dot
without having to use "scene"
you can simply add 2 or 3 "Directionnal Lights"
as Heick said, you will have to save your DOT, after lights corrections.
example : (the angles for dir-light can be change, it's just a personnal choice)
ambient
checkbox 1 = on
color = white
value = 0.3
Directionnal light 1
checkbox 1 = on
checkbox 2 = off
color = white
values = 0.1 / 0.3 / 0.3
position checkbox = off
values = +20 deg / +20 deg
Directionnal light 2
checkbox 1 = on
checkbox 2 = off
color = white
values = 0.05 / 0.2 / 0.3
position checkbox = off
values = -150 deg / +40 deg
Directionnal light 3
checkbox 1 = on
checkbox 2 = off
color = white
values = 0.07 / 0.3 / 0.3
position checkbox = off
values = -40 deg / +20 deg
You could use something like this to edit your existing files. I use this script to toggle scenes and light properties. In its current state it will disable all solidworks lights except ambient and then turn ambient up to 1.
Dim swApp As Object
Dim swModel As ModelDoc2
Dim Scene As SldWorks.SWScene
Dim swConfig As SldWorks.Configuration
Dim P2SFilename As String
Dim newSceneName As String
Dim nLightCount As Integer
Dim vLightProp As Variant
Dim dr As DoubleRec
Dim i2r As Int2Rec
Type DoubleRec
dValue As Double
End Type
Type Int2Rec
iLower As Long ' Assuming that a C int has 4 bytes
iUpper As Long
End Type
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelDocExt = swModel.Extension
Set swConfig = swModel.GetActiveConfiguration
Set Scene = swConfig.GetScene
'detect name of active scene and step to next scene
'https://help.solidworks.com/2015/english/api/sldworksapi/Get_and_Set_Scene_Properties_Example_VB.htm
Scene.GetP2SFileName P2SFilename
If InStr(P2SFilename, "basic.p2s") Then
newSceneName = "Z:\Video & images\Appearances\Scenes\basicDark.p2s"
ElseIf InStr(P2SFilename, "basicDark.p2s") Then
newSceneName = "Z:\Video & images\Appearances\Scenes\dark scene.p2s"
ElseIf InStr(P2SFilename, "dark scene.p2s") Then
newSceneName = "Z:\Video & images\Appearances\Scenes\basic.p2s"
Else 'some other scene so step into basic
newSceneName = "Z:\Video & images\Appearances\Scenes\basic.p2s"
End If
'disable all solidworks lights and turn on ambient all the way
nLightCount = swModel.GetLightSourceCount
For i = 0 To nLightCount - 1
vLightProp = swModel.LightSourcePropertyValues(i)
'http://help.solidworks.com/2016/English/api/sldworksapi/Turn_Lights_On_Example_VB.htm
If InStr(swModel.GetLightSourceName(i), "Ambient") Then 'turn it on
i2r.iLower = 0
i2r.iUpper = 0
LSet dr = i2r
'For j = 0 To UBound(vLightProp) - 1 'use to explore data structure
'Debug.Print j & " " & (vLightProp(j))
'Next j
vLightProp(15) = 1 'set ambient light level to 1
Else 'suppress
i2r.iLower = 1
i2r.iUpper = 1
LSet dr = i2r
End If
vLightProp(17) = dr.dValue
swModel.LightSourcePropertyValues(i) = vLightProp 'apply changes
Next i
result = swModelDocExt.InsertScene(newSceneName)
'Debug.Print (result & " " & newSceneName)
'Debug.Print (" ")
result = swModel.ForceRebuild3(True)
End Sub
Hi,
I don't recommend that. When the lighting (of all lights together) is > no shadow will be displayed.
And in my opinion it will be to bright. But it depends also on the scene, the backgroud and some more parameters, if the lighting is good or not.
In case you speak German, here is a little video on YT about this topic:
SOLIDWORKS Tipps für die Darstellung von Teilen/Baugruppen; relevante Einstellungen, Bühnen, Licht. - YouTube
In case you'll like to it set anyhow, you have to change this value in your document templates for parts and assemblies. With this said, every part/assy has inherited it's own setting and could not be updated trough this change.
The far better way is, to create your own scene with some additional lights, backround settings and so on, and define this as your default scene.