Hello team,
Here I have a problem, I have an intern who designed an ASM with + 200 railings that have a maximum image quality.
Its railings are either on the first level, second level or even more.
My problem is that I have to open each guardrail to lower the quality is saved, it's going to take me a crazy amount of time.
My question is there a macro that would open each part to lower the quality and save the modification.
Thank you.
May the force be with you.
Hello
Normally, if you open the top assembly, then you go to Image Quality (in the options), and you check the option: "Apply to all referenced part documents".
This will apply the image quality to all parts of the open assembly.
edit: with a small image
Hello
Indeed well seen, I'm always looking for noon to 2pm while the solution is in front of my eyes.
good job
may the force be with you.
oops another click of the side
It's fixed.
may the force be with you.
Hello I just made a macro that passes the quality to the minimum:
Option Explicit
’ ******************************************************************************
' by F.PENNERAS
' DEC 27, 2023
’ ******************************************************************************
Early bound variables
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim Part As SldWorks.ModelDoc2
' Variables To Add (Variable Variables)
Dim CurVal As Double
Dim MaxVal As Double
Dim MinVal As Double
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim swTextFormat As SldWorks.TextFormat
Dim TextFormatObj As Object
Dim ModelDocExtension As ModelDocExtension
Sub main()
• Connection to the currently active SolidWorks document
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set Part = swApp.ActiveDoc
Set ModelDocExtension = Part.Extension
'Error handler if no documents are loaded
If Part Is Nothing Then MsgBox "A Solid Works file must be active!", vbCritical: Exit Sub
' Get the current, minimum, and maximum values from the image quality shading deviation preferences.
' Load these values into the variables 'CurVal', 'MinVal' and 'MaxVal'.
swDoc.Extension.GetUserPreferenceDoubleValueRange swImageQualityShadedDeviation, CurVal, MinVal, MaxVal
' Sets a new value for the shading deviation
swDoc.SetUserPreferenceDoubleValue swImageQualityShadedDeviation, MaxVal
' Uncheck the 'Optimize Edge Length' checkbox.
Part.SetUserPreferenceToggle swImageQualityUseHighQualityEdgeSize, False
' Uncheck the 'Save Facetization' box.
Part.SetUserPreferenceToggle swImageQualitySaveTesselationWithPartDoc, False
' Uncheck the 'Improve curve quality' box.
Part.SetUserPreferenceToggle swImageQualityWireframeHighCurveQuality, False
' Set a new value for 'Wireframe resolution and high quality HLR/HLV'.
Part.SetUserPreferenceIntegerValue swImageQualityWireframeValue, 1
End Sub