Skip to content

Commit 72d08c0

Browse files
authored
Merge pull request #6 from xarial/master
Merge commit from upstream
2 parents a79e4be + 1c69303 commit 72d08c0

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

solidworks-api/document/appearance/color-assembly/Macro.vba

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Sub ColorizeComponents(vComps As Variant)
141141
Dim sConfs(0) As String
142142
sConfs(0) = swComp.ReferencedConfiguration
143143
swRefModel.Extension.SetMaterialPropertyValues dMatPrps, IIf(ALL_CONFIGS, swInConfigurationOpts_e.swAllConfiguration, swInConfigurationOpts_e.swSpecifyConfiguration), IIf(ALL_CONFIGS, Empty, sConfs)
144+
swRefModel.SetSaveFlag
144145
End If
145146

146147
End If
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Dim swApp As SldWorks.SldWorks
2+
3+
Sub main()
4+
5+
Set swApp = Application.SldWorks
6+
7+
Dim swModel As SldWorks.ModelDoc2
8+
9+
Set swModel = swApp.ActiveDoc
10+
11+
If Not swModel Is Nothing Then
12+
13+
If swModel.GetType() = swDocumentTypes_e.swDocASSEMBLY Or swModel.GetType() = swDocumentTypes_e.swDocPART Then
14+
15+
Dim vConfNames As Variant
16+
vConfNames = swModel.GetConfigurationNames
17+
18+
Dim i As Integer
19+
20+
For i = 0 To UBound(vConfNames)
21+
Dim swConf As SldWorks.Configuration
22+
Set swConf = swModel.GetConfigurationByName(CStr(vConfNames(i)))
23+
swConf.LargeDesignReviewMark = True
24+
Next
25+
26+
swModel.ForceRebuild3 False
27+
28+
Else
29+
Err.Raise vbError, "", "Only assemblies and parts are supported"
30+
End If
31+
32+
Else
33+
Err.Raise vbError, "", "No files opened"
34+
End If
35+
36+
End Sub

solidworks-api/document/assembly/add-display-data-marks/index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
layout: sw-tool
33
caption: Add Display Data Marks
44
title: Macro to add display data marks to configuration used by the main SOLIDWORKS assembly
5-
description: VBA macro to add display data mark for configurations used in Large assembly to be opened in Large Design Review Mode
5+
description: VBA macro to add display data mark for configurations used in Large assembly to be opened in Large Design Review Mode or eDrawings
66
image: display-data-mark.svg
77
group: Assembly
88
---
9-
This VBA macro is useful for the users working with assemblies in the Large Design Review mode.
9+
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.
1010

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

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

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

21-
{% code-snippet { file-name: Macro.vba } %}
21+
{% code-snippet { file-name: Macro.vba } %}
22+
23+
Alternative version of the macro will only process configurations of the active part or assembly and add the Display Data marks
24+
25+
{% code-snippet { file-name: ActiveDocumentMacro.vba } %}

0 commit comments

Comments
 (0)