Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Sub ColorizeComponents(vComps As Variant)
Dim sConfs(0) As String
sConfs(0) = swComp.ReferencedConfiguration
swRefModel.Extension.SetMaterialPropertyValues dMatPrps, IIf(ALL_CONFIGS, swInConfigurationOpts_e.swAllConfiguration, swInConfigurationOpts_e.swSpecifyConfiguration), IIf(ALL_CONFIGS, Empty, sConfs)
swRefModel.SetSaveFlag
End If

End If
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Dim swApp As SldWorks.SldWorks

Sub main()

Set swApp = Application.SldWorks

Dim swModel As SldWorks.ModelDoc2

Set swModel = swApp.ActiveDoc

If Not swModel Is Nothing Then

If swModel.GetType() = swDocumentTypes_e.swDocASSEMBLY Or swModel.GetType() = swDocumentTypes_e.swDocPART Then

Dim vConfNames As Variant
vConfNames = swModel.GetConfigurationNames

Dim i As Integer

For i = 0 To UBound(vConfNames)
Dim swConf As SldWorks.Configuration
Set swConf = swModel.GetConfigurationByName(CStr(vConfNames(i)))
swConf.LargeDesignReviewMark = True
Next

swModel.ForceRebuild3 False

Else
Err.Raise vbError, "", "Only assemblies and parts are supported"
End If

Else
Err.Raise vbError, "", "No files opened"
End If

End Sub
10 changes: 7 additions & 3 deletions solidworks-api/document/assembly/add-display-data-marks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
layout: sw-tool
caption: Add Display Data Marks
title: Macro to add display data marks to configuration used by the main SOLIDWORKS assembly
description: VBA macro to add display data mark for configurations used in Large assembly to be opened in Large Design Review Mode
description: VBA macro to add display data mark for configurations used in Large assembly to be opened in Large Design Review Mode or eDrawings
image: display-data-mark.svg
group: Assembly
---
This VBA macro is useful for the users working with assemblies in the Large Design Review mode.
This VBA macro is useful for the users working with assemblies in the Large Design Review mode or when it is required to support configurations in eDrawings.

By default only active configuration is preserved for using the the Large Design Review mode and other configurations of the assembly cannot be activated:

Expand All @@ -18,4 +18,8 @@ This macro will traverse all components of the root assembly and find all the us

This will allow to open all sub components in the Large Design Review mode and activate used configurations.

{% code-snippet { file-name: Macro.vba } %}
{% code-snippet { file-name: Macro.vba } %}

Alternative version of the macro will only process configurations of the active part or assembly and add the Display Data marks

{% code-snippet { file-name: ActiveDocumentMacro.vba } %}