AnsweredAssumed Answered

Macro to get Cutlist Property as a Value

Question asked by Vald Mand on Nov 19, 2020
Latest reply on Nov 24, 2020 by Vald Mand

I am trying to get a Cutlist Property, called Quantity as a Value (or Value resolved) with a macro.

Maybe someone can help me with this task?

Here is my code (values returned are empty):

 

Sub main()

    Dim swApp                           As SldWorks.SldWorks
    Dim swModel                         As SldWorks.ModelDoc2
    Dim swFeat                          As SldWorks.Feature
    Dim swCustPropMgr                   As SldWorks.CustomPropertyManager

    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swFeat = swModel.FirstFeature
    Set swCustPropMgr = swFeat.CustomPropertyManager
   
Dim ValueQTY As String
Dim ValueResolvedQTY As String
Dim res As Long

res = swCustPropMgr.Get4("Quantity", True, ValueQTY, ValueResolvedQTY)
Debug.Print ValueQTY; ValueResolvedQTY; " Done"

End Sub

Outcomes