Skip to content

Commit bad5474

Browse files
authored
Merge pull request #306 from stefan-sterk/patch-1
Solved return empty cut-list-item
2 parents 1d86155 + 894e396 commit bad5474

File tree

1 file changed

+12
-3
lines changed
  • solidworks-api/document/cut-lists/copy-custom-properties

1 file changed

+12
-3
lines changed

solidworks-api/document/cut-lists/copy-custom-properties/Macro.vba

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,17 @@ Function GetCutListPropertyManager(model As SldWorks.ModelDoc2) As SldWorks.Cust
5858
While Not swFeat Is Nothing
5959

6060
If swFeat.GetTypeName2() = "CutListFolder" Then
61-
Set GetCutListPropertyManager = swFeat.CustomPropertyManager
62-
Exit Function
61+
62+
Dim BodyFolder As SldWorks.BodyFolder
63+
Set BodyFolder = swFeat.GetSpecificFeature2
64+
65+
Dim BodyCount As Long
66+
BodyCount = BodyFolder.GetBodyCount
67+
68+
If BodyCount <> 0 Then
69+
Set GetCutListPropertyManager = swFeat.CustomPropertyManager
70+
Exit Function
71+
End If
6372
End If
6473

6574
Set swFeat = swFeat.GetNextFeature
@@ -97,4 +106,4 @@ Sub CopyProperties(srcPrpMgr As SldWorks.CustomPropertyManager, targPrpMgr As Sl
97106
Err.Raise vbError, "", "No properties to copy"
98107
End If
99108

100-
End Sub
109+
End Sub

0 commit comments

Comments
 (0)